From 38935e40a999caa42cbfbb09b37fd6ed7309df1d Mon Sep 17 00:00:00 2001 From: Fadli Date: Tue, 30 Aug 2022 00:29:31 +0700 Subject: [PATCH 1/2] - change status to product history status --- src/product/product.service.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/product/product.service.ts b/src/product/product.service.ts index df1642f..d1f4b33 100644 --- a/src/product/product.service.ts +++ b/src/product/product.service.ts @@ -366,11 +366,9 @@ export class ProductService { 'product.currentStatus', 'product.statusHistory', 'history_status', - 'history_status.deleted_at is NULL and history_status.partner_id = :id_partner and history_status.status = ACTIVE', - { - id_partner: user.partner.id, - }, + 'history_status.deleted_at is NULL' ) + .where(`history_status.status = 'ACTIVE'`) .select(['product.id']) .addSelect([ 'product.name', From 0db3bd8c32bbc0a0097bf881e8b2ea24b63ed578 Mon Sep 17 00:00:00 2001 From: Fadli Date: Tue, 30 Aug 2022 00:31:31 +0700 Subject: [PATCH 2/2] - change status to product history status --- src/product/product.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/product/product.service.ts b/src/product/product.service.ts index d1f4b33..df1642f 100644 --- a/src/product/product.service.ts +++ b/src/product/product.service.ts @@ -366,9 +366,11 @@ export class ProductService { 'product.currentStatus', 'product.statusHistory', 'history_status', - 'history_status.deleted_at is NULL' + 'history_status.deleted_at is NULL and history_status.partner_id = :id_partner and history_status.status = ACTIVE', + { + id_partner: user.partner.id, + }, ) - .where(`history_status.status = 'ACTIVE'`) .select(['product.id']) .addSelect([ 'product.name',