fix(SW-898): remove redundant schema and add transform in signupInput

This commit is contained in:
Chuma McPhoy
2024-11-18 15:47:13 +01:00
parent 5c571c3c0c
commit a68e37c26f
3 changed files with 17 additions and 44 deletions
+15 -3
View File
@@ -40,6 +40,18 @@ export const saveCreditCardInput = z.object({
merchantId: z.string().optional(),
})
export const signupInput = signUpSchema.extend({
language: z.nativeEnum(Lang),
})
export const signupInput = signUpSchema
.extend({
language: z.nativeEnum(Lang),
})
.omit({ termsAccepted: true })
.transform((data) => ({
...data,
phoneNumber: data.phoneNumber.replace(/\s+/g, ""),
address: {
...data.address,
city: "",
country: "",
streetAddress: "",
},
}))