add locale and refactor: refs #6274
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2023-12-21 13:58:33 +01:00
parent f384616d69
commit 0998b5bf2c
3 changed files with 10 additions and 10 deletions

View File

@ -329,5 +329,6 @@
"The amount cannot be less than the minimum": "La cantidad no puede ser menor que la cantidad mínima", "The amount cannot be less than the minimum": "La cantidad no puede ser menor que la cantidad mínima",
"quantityLessThanMin": "La cantidad no puede ser menor que la cantidad mínima", "quantityLessThanMin": "La cantidad no puede ser menor que la cantidad mínima",
"Cannot past travels with entries": "No se pueden pasar envíos con entradas", "Cannot past travels with entries": "No se pueden pasar envíos con entradas",
"It was not able to remove the next expeditions:": "No se pudo eliminar las siguientes expediciones: {{expeditions}}" "It was not able to remove the next expeditions:": "No se pudo eliminar las siguientes expediciones: {{expeditions}}",
"Incorrect pin.": "Pin incorrecto."
} }

View File

@ -36,9 +36,9 @@ module.exports = Self => {
Object.assign(myOptions, options); Object.assign(myOptions, options);
const query = 'CALL vn.workerTimeControl_clockIn(?, ?, ?)'; const query = 'CALL vn.workerTimeControl_clockIn(?, ?, ?)';
const [response] = await Self.rawSql(query, [workerFk, timed, direction], myOptions); const [[response]] = await Self.rawSql(query, [workerFk, timed, direction], myOptions);
if (response[0] && response[0].error) if (response && response.error)
throw new UserError(response[0].error); throw new UserError(response.error);
return response; return response;
}; };

View File

@ -8,7 +8,7 @@ module.exports = Self => {
{ {
arg: 'pin', arg: 'pin',
type: 'string', type: 'string',
required: true, required: true
}, },
], ],
returns: { returns: {
@ -27,9 +27,8 @@ module.exports = Self => {
Object.assign(myOptions, options); Object.assign(myOptions, options);
const query = `CALL vn.workerTimeControl_login(?)`; const query = `CALL vn.workerTimeControl_login(?)`;
const user = await Self.rawSql(query, [pin], myOptions); const [[user]] = await Self.rawSql(query, [pin], myOptions);
if (!user) throw new UserError('Incorrect pin.');
if (!user) throw new UserError('Indique el pin.'); return user;
return user[0][0];
}; };
}; };