Skip to content

Commit 95a451a

Browse files
committed
Omit deleted resources from applyQueryFields results
1 parent 4f5dde2 commit 95a451a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/apollo/utils/applyQueryFields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const applyQueryFieldsToSubscriptions = async(subs, queryFields={}, args, contex
249249
});
250250
}
251251
if(queryFields.resources){
252-
const search = { org_id: orgId, 'searchableData.subscription_id': { $in: subUuids } };
252+
const search = { org_id: orgId, 'searchableData.subscription_id': { $in: subUuids }, deleted: false };
253253
if (servSub) delete search.org_id; // service subscriptions push resources to different orgs
254254
var resources = await loadResourcesWithSearchAndArgs({
255255
search,

app/routes/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ async function initialize(){
207207
options: { name: 'org_id.cluster_id.subid.deleted', }
208208
},
209209
{
210-
keys: { 'searchableData.subscription_id': 1},
211-
options: { name: 'searchableData.subscription_id', }
210+
keys: { 'searchableData.subscription_id': 1, deleted: 1},
211+
options: { name: 'searchableData.subscription_id.deleted', }
212212
},
213213
{
214214
keys: { org_id: 1, cluster_id: 1, 'searchableData.kind': 1, 'searchableData.children': 1, deleted: 1 },

0 commit comments

Comments
 (0)