diff --git a/src/core/utils/errorHandler.js b/src/core/utils/errorHandler.js index e380e84..10ff105 100644 --- a/src/core/utils/errorHandler.js +++ b/src/core/utils/errorHandler.js @@ -51,7 +51,20 @@ const isServerError = status => status >= 500 && status <= 599; const isClientError = status => status >= 400 && status <= 499; const errorLogic = (pushToastList, response, t, notification) => { - if (notification) Notifications(pushToastList, "error", t, response.status, response.data.message); + if (notification) { + if (Array.isArray(response.data.message)) { + response.data.message.map((item) => { + Notifications(pushToastList, "error", t, response.status, item); + }); + } else + Notifications( + pushToastList, + "error", + t, + response.status, + response.data.message + ); + } } const errorValidation = (pushToastList, response, t, notification) => { if (notification) {