fixed id for knex call (#105)

* fixed id for knex call

* other fixes for breaking changes in knex api
This commit is contained in:
Arwid Thornström
2022-02-15 09:20:12 +01:00
committed by GitHub
parent 0685902d9f
commit 3d7a36afc4
3 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -148,7 +148,8 @@ export class InteriorAPI extends BaseSQLDataSource {
const res = await this.knex('interiors')
.insert({ print_id: printId, position: position })
.returning('id');
const interiorId = res[0];
const interiorId = res[0].id;
// Move file
moveS3File(
CONFIG.uploadBucket,
+1 -1
View File
@@ -82,7 +82,7 @@ ORDER BY keywords.value
const res = await this.knex('keywords')
.insert({ value: name })
.returning('id');
const keywordId = res[0];
const keywordId = res[0].id;
if (type) {
const typeRes = await this.knex
+1 -1
View File
@@ -397,7 +397,7 @@ export class ProductAPI extends BaseSQLDataSource {
visible: 0,
})
.returning('productid');
const id = idres[0];
const id = idres[0].productid;
this.updateProductField(id, 'artNo', `e${id}`);
await this.updateProductField(id, 'name', name);
await this.updateProductField(id, 'batch', fixedBatch);