diff --git a/CHANGELOG.md b/CHANGELOG.md index adaddb6..0cf30c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to ### Added +- ⚡️(fix) add error when mailbox create failed - ✨(mailbox) allow to reset password on mailboxes #834 ## [1.16.0] - 2025-05-05 diff --git a/src/frontend/apps/desk/src/features/mail-domains/mailboxes/api/useCreateMailbox.tsx b/src/frontend/apps/desk/src/features/mail-domains/mailboxes/api/useCreateMailbox.tsx index d9686db..cea8c0d 100644 --- a/src/frontend/apps/desk/src/features/mail-domains/mailboxes/api/useCreateMailbox.tsx +++ b/src/frontend/apps/desk/src/features/mail-domains/mailboxes/api/useCreateMailbox.tsx @@ -26,10 +26,13 @@ export const createMailbox = async ({ }); if (!response.ok) { - throw new APIError( - 'Failed to create the mailbox', - await errorCauses(response), - ); + const errorData = await errorCauses(response); + console.log('Error data:', errorData); + throw new APIError('Failed to create the mailbox', { + status: errorData.status, + cause: errorData.cause as string[], + data: errorData.data, + }); } }; diff --git a/src/frontend/apps/desk/src/features/mail-domains/mailboxes/components/MailBoxesView.tsx b/src/frontend/apps/desk/src/features/mail-domains/mailboxes/components/MailBoxesView.tsx index b3004fe..ada1e4f 100644 --- a/src/frontend/apps/desk/src/features/mail-domains/mailboxes/components/MailBoxesView.tsx +++ b/src/frontend/apps/desk/src/features/mail-domains/mailboxes/components/MailBoxesView.tsx @@ -127,7 +127,6 @@ export function MailBoxesView({ mailDomain }: { mailDomain: MailDomain }) {