From 25eb5d2f9d31bd081a76d6664635f390287d0b73 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Fri, 15 Sep 2023 08:50:04 +0100 Subject: [PATCH] CLASSROOMIO-T-121: Fetch audience by org in course --- src/lib/utils/services/org/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/utils/services/org/index.js b/src/lib/utils/services/org/index.js index 322b7242..5b0e28f7 100644 --- a/src/lib/utils/services/org/index.js +++ b/src/lib/utils/services/org/index.js @@ -125,14 +125,16 @@ export async function getOrgAudience(orgId) { email, avatar_url, created_at, - organizationmember!inner( + groupmember!inner( role_id, - organization_id + group_id:group!inner( + organization_id + ) ) ` ) - .eq('organizationmember.organization_id', orgId) - .eq('organizationmember.role_id', 3); // is a student, tutor is 2 and admin is 1 + .eq('groupmember.group.organization_id', orgId) + .eq('groupmember.role_id', ROLE.STUDENT); console.log('data', data);