mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: invite-only org signup
This commit is contained in:
parent
689625b0d5
commit
0d775a0fe9
22 changed files with 1733 additions and 387 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { getAPIUrl } from "@services/config/config";
|
||||
import { NextApiRequestCookies } from "next/dist/server/api-utils";
|
||||
|
||||
interface LoginAndGetTokenResponse {
|
||||
access_token: "string";
|
||||
|
|
@ -139,3 +138,18 @@ export async function signup(body: NewAccountBody): Promise<any> {
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function signUpWithInviteCode(body: NewAccountBody,invite_code:string): Promise<any> {
|
||||
const HeadersConfig = new Headers({ "Content-Type": "application/json" });
|
||||
|
||||
const requestOptions: any = {
|
||||
method: "POST",
|
||||
headers: HeadersConfig,
|
||||
body: JSON.stringify(body),
|
||||
redirect: "follow",
|
||||
};
|
||||
|
||||
const res = await fetch(`${getAPIUrl()}users/${body.org_id}/invite/${invite_code}`, requestOptions);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue