feat: add page size in all the rest API

This commit is contained in:
caturbgs
2021-12-22 15:23:05 +07:00
parent cdd6d39c90
commit c3df45dc9a
14 changed files with 135 additions and 124 deletions

View File

@@ -1,10 +1,4 @@
import {
forwardRef,
HttpException,
HttpStatus,
Inject,
Injectable,
} from '@nestjs/common';
import { forwardRef, HttpException, HttpStatus, Inject, Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Connection, Not, Repository } from 'typeorm';
import { CoaService } from '../../transaction/coa.service';
@@ -135,10 +129,10 @@ export class PartnerService {
return partnerData;
};
findAllPartner(page) {
findAllPartner(page, pageSize?) {
return this.partnerRepository.findAndCount({
skip: page * 10,
take: 10,
skip: page * (pageSize || 10),
take: pageSize || 10,
order: {
version: 'DESC',
},