feat: implement partner licenses module with pagination and filtering capabilities
This commit is contained in:
@@ -48,20 +48,20 @@ export class PartnerLicensesService {
|
||||
created_at: true,
|
||||
}
|
||||
|
||||
async findAll(page = 1, pageSize = 10) {
|
||||
const [licenses, count] = await this.prisma.$transaction([
|
||||
async findAll(page = 1, perPage = 10) {
|
||||
const [licenses, total] = await this.prisma.$transaction([
|
||||
this.prisma.licenseActivation.findMany({
|
||||
select: this.licenseDefaultSelect,
|
||||
skip: (page - 1) * pageSize,
|
||||
take: pageSize,
|
||||
skip: (page - 1) * perPage,
|
||||
take: perPage,
|
||||
}),
|
||||
this.prisma.licenseActivation.count(),
|
||||
])
|
||||
|
||||
return ResponseMapper.paginate(licenses, {
|
||||
count,
|
||||
total,
|
||||
page,
|
||||
pageSize,
|
||||
perPage,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user