From ee42cc9acdef86b9fbf4959644aae46e240b5a38 Mon Sep 17 00:00:00 2001 From: Ilham Dwi Pratama S Date: Wed, 22 Dec 2021 07:33:07 +0700 Subject: [PATCH] fix product --- src/product/product.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/product/product.service.ts b/src/product/product.service.ts index a850649..5077910 100644 --- a/src/product/product.service.ts +++ b/src/product/product.service.ts @@ -77,9 +77,9 @@ export class ProductService { 'product.code', 'sub_categories.name', 'category.name', - ]); - // .addSelect('current_price.price') - // .addSelect('(current_price.price + current_price.mark_up_price) as mark_up_price'); + ]) + .addSelect('current_price.price') + .addSelect('(current_price.price + current_price.mark_up_price) as mark_up_price'); if (subCategories != 'null' && subCategories) { baseQuery.andWhere('product.sub_categories_id = :id', { @@ -94,9 +94,9 @@ export class ProductService { // } const data = await baseQuery - .skip(page * 10) - .take(10) - .getMany(); + .offset(page * 10) + .limit(10) + .getRawMany(); const totalData = await baseQuery.getCount();