0
0
Fork 0

refs #6172 feat:enable translation when ticketIsLocked

This commit is contained in:
Javier Segarra 2023-12-15 09:57:03 +01:00
parent a149928015
commit e525f87ccd
3 changed files with 19 additions and 7 deletions

View File

@ -39,12 +39,9 @@ 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;
}
const { response } = error;
const dataError = response?.data?.error;
const code = dataError?.code;
switch (response?.status) {
case 500:
@ -56,7 +53,12 @@ const onResponseError = (error) => {
case 504:
message = 'errors.statusGatewayTimeout';
break;
default:
message = `errors.${dataError?.message}`;
break;
}
if (code) message = code;
if (session.isLoggedIn() && response?.status === 401) {
session.destroy();

View File

@ -71,7 +71,9 @@ export default {
statusGatewayTimeout: 'Could not contact the server',
userConfig: 'Error fetching user config',
create: 'Error during creation',
'This ticket is locked': 'dEste ticket está bloqueado',
},
'This ticket is locked': 'dEste ticket está bloqueado',
login: {
title: 'Login',
username: 'Username',
@ -232,7 +234,7 @@ export default {
agency: 'Agency',
shipped: 'Shipped',
warehouse: 'Warehouse',
customerCard: 'Customer card',
customerCard: 'Customer card'
},
boxing: {
expedition: 'Expedition',
@ -243,6 +245,9 @@ export default {
selectVideo: 'Select video:',
notFound: 'No videos available',
},
error:{
locked: 'This item is locked'
},
summary: {
state: 'State',
salesPerson: 'Sales person',

View File

@ -70,7 +70,9 @@ export default {
statusGatewayTimeout: 'No se ha podido contactar con el servidor',
userConfig: 'Error al obtener configuración de usuario',
create: 'Error al crear',
'This ticket is locked': 'Este ticket está bloqueado',
},
'This ticket is locked': 'Este ticket está bloqueado',
login: {
title: 'Inicio de sesión',
username: 'Nombre de usuario',
@ -241,6 +243,9 @@ export default {
selectVideo: 'Seleccionar vídeo:',
notFound: 'No hay vídeos disponibles',
},
error:{
locked: 'Este item está bloqueado'
},
summary: {
state: 'Estado',
salesPerson: 'Comercial',