feat: implement partner licenses module with pagination and filtering capabilities
This commit is contained in:
+6
-6
@@ -51,16 +51,16 @@ export class PartnerLicenseChargeTransactionService {
|
||||
},
|
||||
}
|
||||
|
||||
async findAll(partner_id: string, page = 1, pageSize = 10) {
|
||||
async findAll(partner_id: string, page = 1, perPage = 10) {
|
||||
const defaultWhere: LicenseChargeTransactionWhereInput = {
|
||||
partner_id,
|
||||
}
|
||||
|
||||
const [transactions, count] = await this.prisma.$transaction(async tx => [
|
||||
const [transactions, total] = await this.prisma.$transaction(async tx => [
|
||||
await tx.licenseChargeTransaction.findMany({
|
||||
where: defaultWhere,
|
||||
skip: (page - 1) * pageSize,
|
||||
take: pageSize,
|
||||
skip: (page - 1) * perPage,
|
||||
take: perPage,
|
||||
select: this.defaultSelect,
|
||||
}),
|
||||
await tx.licenseChargeTransaction.count({
|
||||
@@ -72,8 +72,8 @@ export class PartnerLicenseChargeTransactionService {
|
||||
|
||||
return ResponseMapper.paginate(mappedTransactions, {
|
||||
page,
|
||||
pageSize,
|
||||
count,
|
||||
perPage,
|
||||
total,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user