Merge branch 'development' into 'devops-staging'

fix: get product for transaction

See merge request empatnusabangsa/ppob/ppob-backend!52
This commit is contained in:
ilham dwi pratama 2021-12-22 17:14:14 +00:00
commit b919100711

View File

@ -246,7 +246,12 @@ export class ProductService {
'product.currentPrice', 'product.currentPrice',
'product.priceHistory', 'product.priceHistory',
'current_price', 'current_price',
'current_price.partner_id is null', 'current_price.partner_id is NULL and current_price.end_date is NULL',
)
.select(['product.id'])
.addSelect(['product.name', 'product.code', 'sub_categories.name'])
.addSelect(
'(current_price.price + current_price.mark_up_price) as price',
); );
if (subCategories != 'null' && subCategories) { if (subCategories != 'null' && subCategories) {
@ -256,9 +261,9 @@ export class ProductService {
} }
const data = await baseQuery const data = await baseQuery
.skip(page * (pageSize || 10)) .offset(page * 10)
.take(pageSize || 10) .limit(10)
.getMany(); .getRawMany();
const totalData = await baseQuery.getCount(); const totalData = await baseQuery.getCount();