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')
|
const res = await this.knex('interiors')
|
||||||
.insert({ print_id: printId, position: position })
|
.insert({ print_id: printId, position: position })
|
||||||
.returning('id');
|
.returning('id');
|
||||||
const interiorId = res[0];
|
|
||||||
|
const interiorId = res[0].id;
|
||||||
// Move file
|
// Move file
|
||||||
moveS3File(
|
moveS3File(
|
||||||
CONFIG.uploadBucket,
|
CONFIG.uploadBucket,
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ ORDER BY keywords.value
|
|||||||
const res = await this.knex('keywords')
|
const res = await this.knex('keywords')
|
||||||
.insert({ value: name })
|
.insert({ value: name })
|
||||||
.returning('id');
|
.returning('id');
|
||||||
const keywordId = res[0];
|
const keywordId = res[0].id;
|
||||||
|
|
||||||
if (type) {
|
if (type) {
|
||||||
const typeRes = await this.knex
|
const typeRes = await this.knex
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ export class ProductAPI extends BaseSQLDataSource {
|
|||||||
visible: 0,
|
visible: 0,
|
||||||
})
|
})
|
||||||
.returning('productid');
|
.returning('productid');
|
||||||
const id = idres[0];
|
const id = idres[0].productid;
|
||||||
this.updateProductField(id, 'artNo', `e${id}`);
|
this.updateProductField(id, 'artNo', `e${id}`);
|
||||||
await this.updateProductField(id, 'name', name);
|
await this.updateProductField(id, 'name', name);
|
||||||
await this.updateProductField(id, 'batch', fixedBatch);
|
await this.updateProductField(id, 'batch', fixedBatch);
|
||||||
|
|||||||
Reference in New Issue
Block a user