Skip to content

Commit

Permalink
fix: email in the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
darkoatanasovski committed Jan 24, 2023
1 parent 22f6640 commit 852f531
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/stores/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ export async function updateUser(values: FirstLastNameInput | EmailConfirmPasswo
};
}

const response = await accountService.updateCustomer({ ...{ ...values, email: user.email }, id: user.id.toString() }, sandbox, auth.jwt);
let payload = values;
if (!canUpdateEmail) {
payload = { ...values, email: user.email };
}

const response = await accountService.updateCustomer({ ...payload, id: user.id.toString() }, sandbox, auth.jwt);

if (!response) {
throw new Error('Unknown error');
Expand Down

0 comments on commit 852f531

Please sign in to comment.