1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-17 12:10:39 +01:00

fix: update a row with a string key value

This commit is contained in:
Fabio 2020-08-13 13:22:04 +02:00
parent 3c6e818ba0
commit eb348b3095

View File

@ -16,6 +16,7 @@ export default class {
static async updateTableCell (connection, params) {
let escapedParam;
let reload = false;
const id = typeof params.id === 'number' ? params.id : `"${params.id}"`;
if (NUMBER.includes(params.type))
escapedParam = params.content;
@ -37,7 +38,7 @@ export default class {
.update({ [params.field]: `= ${escapedParam}` })
.schema(params.schema)
.from(params.table)
.where({ [params.primary]: `= ${params.id}` })
.where({ [params.primary]: `= ${id}` })
.run();
return { reload };