Update customer data in Account Settings requires first name, last name and email, and an optional company:
|
export const updateAccountSchema = z.object({ |
|
firstName: z.string().min(2).trim(), |
|
lastName: z.string().min(2).trim(), |
|
email: z.string().email().trim(), |
|
company: z.string().trim().optional(), |
|
}); |
However, the update function only sends the first name and last name to actually update. The email, nor the company is updated.
|
customer { |
|
firstName |
|
lastName |
|
} |
Additionally, if a new field was added later (e.g. Terms and Conditions) which is now required. Then older accounts cannot update their info because the field is required, but there is no option to change it:
1:{"account":"$T0:0:account","lastResult":{"status":"error","intent":"$undefined","initialValue":{"company":"XXXXX","email":"xxxxx@xxx.com","firstName":"XXXX","intent":"update","lastName":"XXXXX"},"error":{"":["Required account form field ID 26 ('Terms and Conditions') is missing"]},"state":"$undefined","fields":["firstName","lastName","email","company","intent"]}}
Update customer data in Account Settings requires first name, last name and email, and an optional company:
catalyst/core/vibes/soul/sections/account-settings/schema.ts
Lines 11 to 16 in 81b88df
However, the update function only sends the first name and last name to actually update. The email, nor the company is updated.
catalyst/core/app/[locale]/(default)/account/settings/_actions/update-customer.ts
Lines 19 to 22 in 81b88df
Additionally, if a new field was added later (e.g. Terms and Conditions) which is now required. Then older accounts cannot update their info because the field is required, but there is no option to change it:
1:{"account":"$T0:0:account","lastResult":{"status":"error","intent":"$undefined","initialValue":{"company":"XXXXX","email":"xxxxx@xxx.com","firstName":"XXXX","intent":"update","lastName":"XXXXX"},"error":{"":["Required account form field ID 26 ('Terms and Conditions') is missing"]},"state":"$undefined","fields":["firstName","lastName","email","company","intent"]}}