Skip to content

Commit 52fc032

Browse files
committed
eng-1720 utility function for create-group
1 parent 3f90fb1 commit 52fc032

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

apps/website/app/utils/supabase/account.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,15 @@ export const getSessionUserData = async (
4545
}
4646
return { id, name: accountReq.data.name, type: "person", email };
4747
};
48+
49+
export const createGroup = async (
50+
client: DGSupabaseClient,
51+
name: string,
52+
): Promise<string | null> => {
53+
// eslint-disable-next-line: @typescript-eslint/naming-convention
54+
const result = await client.functions.invoke<{ group_id: string }>(
55+
"create-group",
56+
{ body: { name } },
57+
);
58+
return result.data?.group_id || null;
59+
};

0 commit comments

Comments
 (0)