Skip to content

Commit

Permalink
fix: exclude deleted when looking up by external id
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jul 12, 2024
1 parent 460cdfd commit 0fc6b06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (t *TempCache) Find(ctx ScrapeContext, lookup v1.ExternalID) (*models.Confi
}

var result models.ConfigItem
query := ctx.DB().Limit(1).Where("type = ? and external_id @> ?", lookup.ConfigType, pq.StringArray{externalID})
query := ctx.DB().Limit(1).Where("deleted_at IS NOT NULL").Where("type = ? and external_id @> ?", lookup.ConfigType, pq.StringArray{externalID})
if scraperID != "all" && scraperID != "" {
query = query.Where("scraper_id = ?", scraperID)
}
Expand Down

0 comments on commit 0fc6b06

Please sign in to comment.