add message array
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user