From 0131716e724226e1e9eef87691741a35e8fbc47d Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 7 Nov 2024 11:54:22 +0530 Subject: [PATCH] chore(push): only delete non deleted components --- push/topology.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/push/topology.go b/push/topology.go index f2b917cd..a69bdba3 100644 --- a/push/topology.go +++ b/push/topology.go @@ -70,7 +70,7 @@ func PushTopology(c echo.Context) error { } var idsToDelete []string - if err := ctx.DB().Model(&models.Component{}).Select("id").Where("topology_id = ?", data.TopologyID).Where("id NOT IN ?", returnedIDs).Find(&idsToDelete).Error; err != nil { + if err := ctx.DB().Model(&models.Component{}).Select("id").Where("topology_id = ?", data.TopologyID).Where("deleted_at IS NULL").Where("id NOT IN ?", returnedIDs).Find(&idsToDelete).Error; err != nil { return dutyAPI.WriteError(c, dutyAPI.Errorf(dutyAPI.EINTERNAL, "error querying old components: %v", dutydb.ErrorDetails(err))) }