feat: add page size in all the rest API
This commit is contained in:
@@ -38,6 +38,7 @@ export class ProductHistoryPriceService {
|
||||
page: number,
|
||||
productId: string,
|
||||
supplierId: string,
|
||||
pageSize?: number,
|
||||
) {
|
||||
try {
|
||||
const query = this.productHistoryPriceService
|
||||
@@ -54,8 +55,8 @@ export class ProductHistoryPriceService {
|
||||
|
||||
const data = await query
|
||||
.orderBy('product_history_price.createdAt', 'DESC')
|
||||
.skip(page * 10)
|
||||
.take(10)
|
||||
.skip(page * (pageSize || 10))
|
||||
.take(pageSize || 10)
|
||||
.getMany();
|
||||
|
||||
const totalData = await query.getCount();
|
||||
|
||||
Reference in New Issue
Block a user