From a2902ef6839260b5c57d737334001c4a95c34ba1 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Fri, 12 Jul 2024 20:01:46 +0545 Subject: [PATCH] fix: exclude deleted when looking up by external id --- api/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/cache.go b/api/cache.go index 0efd22285..ea42b38c2 100644 --- a/api/cache.go +++ b/api/cache.go @@ -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 NULL").Where("type = ? and external_id @> ?", lookup.ConfigType, pq.StringArray{externalID}) if scraperID != "all" && scraperID != "" { query = query.Where("scraper_id = ?", scraperID) }