export const organizationAdminQuery = customQuery(
query,
customCtx(async (ctx) => {
const userId = await getAuthUserIdOrFail(ctx);
return { ...ctx, userId };
})
);
// These queries are only available to the organization admin
export const orgAdminQuery = organizationAdminQuery({
args: { organizationId: v.id("organization") },
handler: async (ctx, { organizationId }) => {
return getOrganizationAdmins(organizationId)
},
});
export const getOrganizationSponsorsQuery = organizationAdminQuery({
args: { organizationId: v.id("organization") },
handler: async (ctx, { organizationId }) => {
return getOrganizationAdmins(organizationId)
},
});
export const organizationAdminQuery = customQuery(
query,
customCtx(async (ctx) => {
const userId = await getAuthUserIdOrFail(ctx);
return { ...ctx, userId };
})
);
// These queries are only available to the organization admin
export const orgAdminQuery = organizationAdminQuery({
args: { organizationId: v.id("organization") },
handler: async (ctx, { organizationId }) => {
return getOrganizationAdmins(organizationId)
},
});
export const getOrganizationSponsorsQuery = organizationAdminQuery({
args: { organizationId: v.id("organization") },
handler: async (ctx, { organizationId }) => {
return getOrganizationAdmins(organizationId)
},
});