Skip to content

Commit

Permalink
chore(push): only delete non deleted components
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Nov 7, 2024
1 parent 4787c8b commit 0131716
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion push/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}

Expand Down

0 comments on commit 0131716

Please sign in to comment.