Skip to content

Commit

Permalink
Fix signup (#274)
Browse files Browse the repository at this point in the history
* profile page UI

* fetch the necessary data

* fetch all available info

* add bio editing

* disply profile picture

* add profile image

* fix routing

* update profile

* fix signup

---------

Co-authored-by: uwituzeb <[email protected]>
  • Loading branch information
berniceu and uwituzeb authored Dec 2, 2024
1 parent 598f715 commit 330f738
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/form/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function SignupForm() {
const parsedData = registerSchema.parse(data);
const response = await axios.post(`${process.env.BACKEND_URL}`, {
query: `
mutation CreateUser($userInput: UserInput_Logged) {
mutation ($userInput: UserInput_Logged) {
createUser_Logged(userInput: $userInput) {
country
email
Expand Down Expand Up @@ -132,12 +132,13 @@ function SignupForm() {
gender: parsedData.gender,
email: parsedData.email,
password: parsedData.password,
telephone: `${parsedData.countryCode} ${parsedData.phoneNumber}`,
telephone: `${parsedData.countryCode} ${parsedData.phoneNumber}`
},
},
});
if (response.data.errors) {
const error = response.data.errors[0].message;
// console.log(error);
if (
error.includes("E11000 duplicate key error collection") &&
error.includes("email_1 dup key")
Expand Down
2 changes: 2 additions & 0 deletions src/components/validation/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const registerSchema: ZodType<formData> = z.object({
acceptTerms: z.boolean().refine((value) => value === true, {
message: "accept",
}),
bio: z.string().optional(),
});
export type RolePermission = {
Name: string;
Expand Down Expand Up @@ -103,6 +104,7 @@ export const googleDataSchema: ZodType<googleFormData> = z.object({
message: "gender is required",
}
),
bio: z.string().optional(),

});

0 comments on commit 330f738

Please sign in to comment.