fixed id for knex call (#105)
* fixed id for knex call * other fixes for breaking changes in knex api
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user