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:
parent
3c6e818ba0
commit
eb348b3095
@ -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 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user