diff --git a/apps/api/.gitignore b/apps/api/.gitignore index d3de4f6f..07437551 100644 --- a/apps/api/.gitignore +++ b/apps/api/.gitignore @@ -162,7 +162,7 @@ dmypy.json # Cython debug symbols cython_debug/ - +.idea/ # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore diff --git a/apps/web/app/orgs/[orgslug]/signup/signup.tsx b/apps/web/app/orgs/[orgslug]/signup/signup.tsx index b22454f0..c154b362 100644 --- a/apps/web/app/orgs/[orgslug]/signup/signup.tsx +++ b/apps/web/app/orgs/[orgslug]/signup/signup.tsx @@ -61,6 +61,7 @@ function SignUpClient(props: SignUpClientProps) { const formik = useFormik({ initialValues: { org_slug: props.org?.slug, + org_id: props.org?.id, email: '', password: '', username: '', @@ -70,6 +71,8 @@ function SignUpClient(props: SignUpClientProps) { }, validate, onSubmit: async values => { + setError('') + setMessage('') setIsSubmitting(true); let res = await signup(values); let message = await res.json(); @@ -81,6 +84,7 @@ function SignUpClient(props: SignUpClientProps) { else if (res.status == 401 || res.status == 400 || res.status == 404 || res.status == 409) { setError(message.detail); setIsSubmitting(false); + } else { setError("Something went wrong"); diff --git a/apps/web/services/auth/auth.ts b/apps/web/services/auth/auth.ts index 623da877..7269f1a6 100644 --- a/apps/web/services/auth/auth.ts +++ b/apps/web/services/auth/auth.ts @@ -122,6 +122,7 @@ interface NewAccountBody { email: string; password: string; org_slug: string; + org_id:string; } export async function signup(body: NewAccountBody): Promise { @@ -134,6 +135,7 @@ export async function signup(body: NewAccountBody): Promise { redirect: "follow", }; - const res = await fetch(`${getAPIUrl()}users/?org_slug=${body.org_slug}`, requestOptions); + const res = await fetch(`${getAPIUrl()}users/${body.org_id}`, requestOptions); + return res; }