Add mutation to add keywords (#24)

This commit is contained in:
Niklas Fondberg
2021-09-06 12:53:51 +02:00
committed by GitHub
parent 8d83205747
commit d5945da7ae
5 changed files with 48 additions and 4 deletions
+3 -3
View File
@@ -214,14 +214,14 @@ export class ProductAPI extends BaseSQLDataSource {
ON CONFLICT (product_id, group_id, market_id)
DO NOTHING`;
const insertsPromises = [];
const deleteQuery = this.knex.raw(
await this.knex.raw(
/* sql */ `
DELETE FROM product_blacklist WHERE product_id = ?
`,
[productId],
);
insertsPromises.push(deleteQuery);
const insertsPromises = [];
markets.forEach((market) => {
market.groupIds.forEach((groupId) => {
const query = this.knex.raw(sql, [productId, groupId, market.marketId]);