You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letsubQuery=`SELECT jsonb_object_keys(users) AS account_id FROM projects WHERE project_id=$1`;
23
+
24
+
constqueryParams=[project_id];
25
+
26
+
if(account_id){
27
+
queryParams.push(account_id);
28
+
subQuery+=` AND users ? $${queryParams.length}::TEXT`;
29
+
}
30
+
21
31
constresult=awaitpool.query(
22
-
"SELECT accounts.account_id, accounts.first_name, accounts.last_name FROM accounts, (SELECT jsonb_object_keys(users) AS account_id FROM projects WHERE project_id=$1) AS users WHERE accounts.account_id=users.account_id::UUID AND accounts.unlisted IS NOT TRUE",
23
-
[project_id]
32
+
`SELECT accounts.account_id, accounts.first_name, accounts.last_name FROM accounts, (${subQuery})
33
+
AS users WHERE accounts.account_id=users.account_id::UUID
0 commit comments