feat: implement partner licenses module with pagination and filtering capabilities
This commit is contained in:
+5
-5
@@ -20,10 +20,10 @@ export class SalesInvoicesService {
|
||||
},
|
||||
}
|
||||
|
||||
const pageSize = 10
|
||||
const perPage = 10
|
||||
const page = 1
|
||||
|
||||
const [items, count] = await this.prisma.$transaction([
|
||||
const [items, total] = await this.prisma.$transaction([
|
||||
this.prisma.salesInvoice.findMany({
|
||||
where: defaultWhere,
|
||||
select: {
|
||||
@@ -91,14 +91,14 @@ export class SalesInvoicesService {
|
||||
},
|
||||
unknown_customer: true,
|
||||
},
|
||||
skip: (page - 1) * pageSize,
|
||||
take: pageSize,
|
||||
skip: (page - 1) * perPage,
|
||||
take: perPage,
|
||||
}),
|
||||
this.prisma.salesInvoice.count({
|
||||
where: defaultWhere,
|
||||
}),
|
||||
])
|
||||
return ResponseMapper.paginate(items, { count, page, pageSize })
|
||||
return ResponseMapper.paginate(items, { total, page, perPage })
|
||||
}
|
||||
|
||||
findOne(complex_id: string, pos_id: string, id: string) {
|
||||
|
||||
Reference in New Issue
Block a user