You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
| 1234567891011121314 |
- import i18next from 'i18next';
-
- export const rejectErrorCodeHelper = (error) => {
- if (error?.response?.data?.Errors) {
- const errorCode = error?.response?.data?.Errors[0]?.Code;
- const errorMessage = errorCode
- ? i18next.t(`apiErrors.${errorCode}`)
- : i18next.t(error.response.data.message);
-
- return errorMessage;
- }
-
- return i18next.t(error.response.data.message);
- };
|