feat: add organization_ids in the user(s) response (#1184)

This commit is contained in:
Bruno Quaresma
2022-04-28 09:10:17 -05:00
committed by GitHub
parent a7fb018414
commit 816441eff7
8 changed files with 165 additions and 34 deletions
@@ -20,3 +20,13 @@ INSERT INTO
)
VALUES
($1, $2, $3, $4, $5) RETURNING *;
-- name: GetOrganizationIDsByMemberIDs :many
SELECT
user_id, array_agg(organization_id) :: uuid [ ] AS "organization_IDs"
FROM
organization_members
WHERE
user_id = ANY(@ids :: uuid [ ])
GROUP BY
user_id;