From a5d032f0224f4184bcf619762ff569656765bc0c Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 13 Nov 2024 17:29:19 +0100 Subject: [PATCH] feat: make additional data object --- src/boot/quasar.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/boot/quasar.js b/src/boot/quasar.js index 103b4812e56..a018eede728 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -5,12 +5,10 @@ import qFormMixin from './qformMixin'; import keyShortcut from './keyShortcut'; import { i18n } from './i18n'; import useNotify from 'src/composables/useNotify.js'; -import { useStateQueryStore } from 'src/stores/useStateQueryStore'; import VnInput from 'src/components/common/VnInput.vue'; import { useVnConfirm } from 'src/composables/useVnConfirm'; const { notify } = useNotify(); -const stateQuery = useStateQueryStore(); const { openConfirmationModal } = useVnConfirm(); export default boot(({ app }) => { @@ -53,13 +51,25 @@ export default boot(({ app }) => { message = 'Duplicate request'; } + const { config, headers, request, status, statusText, data } = response || {}; + const { params, url, method, signal, headers: confHeaders } = config || {}; + const { message: resMessage, code, name } = data?.error || {}; const additionalData = { - frontPath: '', - backError: { - config: error.config, - data: error, + path: location.href, + message: resMessage, + code, + request: request?.responseURL, + status, + name, + statusText: statusText, + config: { + url, + method, + params, + headers: confHeaders, + aborted: signal.aborted, + version: headers?.['salix-version'], }, - httpRequest: error.request.response, }; const opts = { actions: [ @@ -72,9 +82,7 @@ export default boot(({ app }) => { handler: async () => { const locale = i18n.global.t; const reason = ref( - response.data.error.code == 'ACCESS_DENIED' - ? locale('cau.askPrivileges') - : '' + code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : '' ); openConfirmationModal( locale('cau.title'),