Added designers
This commit is contained in:
@@ -45,11 +45,12 @@ export class ProductAPI extends SQLDataSource {
|
||||
}
|
||||
|
||||
getPrintProducts(row: any): Array<PrintProduct> {
|
||||
if (!row.printProducts) {
|
||||
if (!row.printproducts) {
|
||||
return [];
|
||||
}
|
||||
return row.printProducts.map((pp: any) => {
|
||||
return row.printproducts.map((pp: any) => {
|
||||
pp.group = ProductGroup[pp.groupId];
|
||||
pp.id = pp.printId;
|
||||
return pp;
|
||||
});
|
||||
}
|
||||
@@ -66,6 +67,7 @@ export class ProductAPI extends SQLDataSource {
|
||||
data.rows.map((row) => {
|
||||
row.blacklisting = this.getBlacklisting(row);
|
||||
row.printProducts = this.getPrintProducts(row);
|
||||
row.designerId = row.designerid;
|
||||
return row;
|
||||
}),
|
||||
);
|
||||
@@ -76,8 +78,10 @@ export class ProductAPI extends SQLDataSource {
|
||||
|
||||
const res = await this.knex.raw(query).then((data) =>
|
||||
data.rows.map((row) => {
|
||||
console.log(row);
|
||||
row.blacklisting = this.getBlacklisting(row);
|
||||
row.printProducts = this.getPrintProducts(row);
|
||||
row.designerId = row.designerid;
|
||||
return row;
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user