feat(WEB-162): final design edit profile page
This commit is contained in:
committed by
Christel Westerberg
parent
5f3e417593
commit
d84efcbb0f
@@ -7,6 +7,7 @@ import { countriesMap } from "@/components/TempDesignSystem/Form/Country/countri
|
||||
export const getUserSchema = z.object({
|
||||
address: z.object({
|
||||
city: z.string().optional(),
|
||||
country: z.string().optional(),
|
||||
countryCode: z.nativeEnum(countriesMap).optional(),
|
||||
streetAddress: z.string().optional(),
|
||||
zipCode: z.string(),
|
||||
|
||||
@@ -56,8 +56,6 @@ export const userQueryRouter = router({
|
||||
}
|
||||
|
||||
const apiJson = await apiResponse.json()
|
||||
console.log({ apiJson })
|
||||
console.log({ attr: apiJson.data.attributes })
|
||||
if (!apiJson.data?.attributes) {
|
||||
// throw notFound(apiJson)
|
||||
console.error(
|
||||
@@ -78,12 +76,14 @@ export const userQueryRouter = router({
|
||||
const country = countries.find(
|
||||
(c) => c.code === verifiedData.data.address.countryCode
|
||||
)
|
||||
const phonenumber = parsePhoneNumber(verifiedData.data.phoneNumber)
|
||||
|
||||
const user = {
|
||||
...extendedUser,
|
||||
address: {
|
||||
city: verifiedData.data.address.city,
|
||||
country: country?.name ?? verifiedData.data.address.countryCode,
|
||||
country: country?.name ?? "",
|
||||
countryCode: verifiedData.data.address.countryCode,
|
||||
streetAddress: verifiedData.data.address.streetAddress,
|
||||
zipCode: verifiedData.data.address.zipCode,
|
||||
},
|
||||
@@ -94,7 +94,7 @@ export const userQueryRouter = router({
|
||||
lastName: verifiedData.data.lastName,
|
||||
memberships: verifiedData.data.memberships,
|
||||
name: `${verifiedData.data.firstName} ${verifiedData.data.lastName}`,
|
||||
phoneNumber: verifiedData.data.phoneNumber,
|
||||
phoneNumber: phonenumber.formatInternational(),
|
||||
profileId: verifiedData.data.profileId,
|
||||
}
|
||||
|
||||
@@ -111,7 +111,6 @@ export const userQueryRouter = router({
|
||||
user.address.zipCode = maskValue.text(verifiedData.data.address.zipCode)
|
||||
user.email = maskValue.email(user.email)
|
||||
|
||||
const phonenumber = parsePhoneNumber(user.phoneNumber)
|
||||
user.phoneNumber = `+${phonenumber.countryCallingCode} ${maskValue.phone(user.phoneNumber)}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user