diff --git a/public/js/plugins/Api.js b/public/js/plugins/Api.js index 0b8e2fd17..895ecf70d 100644 --- a/public/js/plugins/Api.js +++ b/public/js/plugins/Api.js @@ -328,6 +328,7 @@ export default { url: error.request.responseURL }]; } else { + if (error.response.data.errors == undefined) return []; return error.response.data.errors; } } else if (error.request) { @@ -346,6 +347,9 @@ export default { function popHandleableErrors(errorHandling, errors) { const result = {}; const copy = []; + + if (errors == undefined) return {}; + while (errors.length) copy.push(errors.pop()); for (var error of copy) { @@ -551,4 +555,4 @@ export default { app.provide('$api', app.config.globalProperties.$api); } -}; \ No newline at end of file +};