From 876842eb531f384e4322a36fa317e2dc15aa54cb Mon Sep 17 00:00:00 2001 From: ilham Date: Fri, 11 Mar 2022 00:25:06 +0700 Subject: [PATCH] add: order by in product retail --- src/product/product.service.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/product/product.service.ts b/src/product/product.service.ts index 43cecdf..28fd04d 100644 --- a/src/product/product.service.ts +++ b/src/product/product.service.ts @@ -263,9 +263,8 @@ export class ProductService { ) .select(['product.id']) .addSelect(['product.name', 'product.code', 'sub_categories.name']) - .addSelect( - '(current_price.price + current_price.mark_up_price) as price', - ); + .addSelect('(current_price.price + current_price.mark_up_price) as price') + .orderBy('price', 'ASC'); if (subCategories != 'null' && subCategories) { baseQuery.andWhere('product.sub_categories_id = :id', {