From dba9f811249322565e4357ac9c09ab7fb14ea5ed Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Wed, 16 Sep 2020 15:58:11 +0100 Subject: [PATCH] Add initiators to the 'associated' return The query resolver 'associated' should also return query initiators to its return value. This commit adds this. --- resolvers/queries.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resolvers/queries.js b/resolvers/queries.js index dbe5e08..7428a31 100644 --- a/resolvers/queries.js +++ b/resolvers/queries.js @@ -99,9 +99,11 @@ const queryResolvers = { // Returns a promise resolving to an array of user IDs associated: async (query_ids) => { const participants = await queryResolvers.participants(query_ids); + const initiators = await queryResolvers.initiators(query_ids); const allStaff = await userResolvers.allStaff(); let deDup = {}; participants.rows.forEach((pRow) => (deDup[pRow.creator_id] = 1)); + initiators.rows.forEach((iRow) => (deDup[iRow.initiator] = 1)); allStaff.rows.forEach((sRow) => (deDup[sRow.id] = 1)); return Object.keys(deDup).map((key) => parseInt(key)); },