#6274 workerTimeControl #1858
|
@ -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
|
|
@ -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
alexm
commented
Si es el caso puedes hacer:
Es decir, hacer 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;
|
||||
};
|
||||
|
|
|
@ -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
alexm
commented
Falta traduccion Falta traduccion
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
ayer no hablamos de no poner puntos? son estos casos?
cierto