0
0
Fork 0

Compare commits

...

14 Commits

Author SHA1 Message Date
Javi Gallego 02272143d3 Merge branch 'dev' into 6172_transfer_ticket_message_error 2024-01-10 08:20:27 +00:00
Javier Segarra 387d7a33e6 Merge branch 'dev' into 6172_transfer_ticket_message_error 2024-01-03 08:24:39 +00:00
Javier Segarra da00a3f05f Merge branch 'dev' into 6172_transfer_ticket_message_error 2024-01-03 07:08:19 +00:00
Javier Segarra 44e9c5f3d9 refs #6172 perf: clean code axios.js 2024-01-02 14:48:56 +01:00
Javier Segarra 8631b642eb Merge branch 'dev' into 6172_transfer_ticket_message_error 2024-01-02 11:23:38 +00:00
Javier Segarra 31d000b65f refs #6172 perf: remove translation 2024-01-02 12:00:12 +01:00
Javier Segarra 1b0cfa0d86 Merge branch 'dev' into 6172_transfer_ticket_message_error 2023-12-22 10:20:22 +00:00
Javier Segarra 1c9493839d refs #6172 test: fix test 2023-12-20 14:47:34 +01:00
Javier Segarra 897d410ee6 refs #6434 perf: remove replace function
Será efectivo el cambio cuando se modifique en salix-back
2023-12-15 11:11:13 +00:00
Javier Segarra ca314c65d8 refs #6172 perf: remove message code 2023-12-15 10:08:59 +01:00
Javier Segarra 134cf011e3 Merge branch '6172_transfer_ticket_message_error' of https://gitea.verdnatura.es/verdnatura/salix-front into 6172_transfer_ticket_message_error 2023-12-15 10:07:46 +01:00
Javier Segarra c4416545f8 refs #6172 feat: use RegExp when message finish with . 2023-12-15 10:07:41 +01:00
Javier Segarra 8cfd775d58 Merge branch 'dev' into 6172_transfer_ticket_message_error 2023-12-15 08:57:52 +00:00
Javier Segarra e525f87ccd refs #6172 feat:enable translation when ticketIsLocked 2023-12-15 09:57:03 +01:00
2 changed files with 13 additions and 17 deletions

View File

@ -37,14 +37,11 @@ const onResponse = (response) => {
};
const onResponseError = (error) => {
let message = '';
const response = error.response;
const responseData = response && response.data;
const responseError = responseData && response.data.error;
if (responseError) {
message = responseError.message;
if (!session.isLoggedIn()) {
return Promise.reject(error);
}
const { response } = error;
let message = response?.data?.error?.message;
switch (response?.status) {
case 500:
@ -56,15 +53,14 @@ const onResponseError = (error) => {
case 504:
message = 'errors.statusGatewayTimeout';
break;
}
if (session.isLoggedIn() && response?.status === 401) {
session.destroy();
const hash = window.location.hash;
const url = hash.slice(1);
Router.push({ path: url });
} else if (!session.isLoggedIn()) {
return Promise.reject(error);
case 401:
if (session.isLoggedIn()) {
session.destroy();
const hash = window.location.hash;
const url = hash.slice(1);
Router.push({ path: url });
}
break;
}
Notify.create({

View File

@ -233,7 +233,7 @@ export default {
agency: 'Agency',
shipped: 'Shipped',
warehouse: 'Warehouse',
customerCard: 'Customer card',
customerCard: 'Customer card'
},
boxing: {
expedition: 'Expedition',