diff --git a/src/helpers/errors.js b/src/helpers/errors.js deleted file mode 100644 index 4022678e8..000000000 --- a/src/helpers/errors.js +++ /dev/null @@ -1,42 +0,0 @@ -import { showError } from '@nextcloud/dialogs' -import { forEach, get, isString } from 'lodash-es' - -const showErrors = errList => { - forEach(errList, err => { - isString() - ? showError(err) - : showError(err.message ?? err) - }) -} - -const showResponseError = res => { - const errors = get(res, ['data', 'errors']) - - if (errors) { - return showErrors(errors) - } - - const messages = get(res, ['data', 'messages']) - - if (messages) { - return showErrors(messages) - } - - const message = get(res, ['data', 'message'], res?.message) - - return showError(message || 'unknown error') -} - -const onError = err => { - if (err.response) { - return showResponseError(err.response) - } - - return showError(err.message) -} - -export { - onError, - showResponseError, - showErrors, -} diff --git a/src/views/Account/partials/Documents.vue b/src/views/Account/partials/Documents.vue index ee04a16cf..21510fecf 100644 --- a/src/views/Account/partials/Documents.vue +++ b/src/views/Account/partials/Documents.vue @@ -55,12 +55,11 @@