#6274 workerTimeControl #1858

Merged
jorgep merged 31 commits from 6274-loginWorkerTimeControl into dev 2024-01-03 11:31:52 +00:00
3 changed files with 10 additions and 10 deletions
Showing only changes of commit 0998b5bf2c - Show all commits

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",
"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",
"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."
}
jorgep marked this conversation as resolved Outdated

ayer no hablamos de no poner puntos? son estos casos?

ayer no hablamos de no poner puntos? son estos casos?

cierto

cierto

View File

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

Si es el caso puedes hacer:

const myArray = [[{}]]
const [[myNewArray]] = myArray
console.log(myNewArray) // Devuelve {}

Es decir, hacer const [[response]] = y te evitas luego hacer response[0]

Si es el caso puedes hacer: ``` const myArray = [[{}]] const [[myNewArray]] = myArray console.log(myNewArray) // Devuelve {} ``` Es decir, hacer `const [[response]] =` y te evitas luego hacer response[0]
if (response && response.error)
throw new UserError(response.error);
return response;
};

View File

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

Falta traduccion

Falta traduccion
};
};