no message

This commit is contained in:
Kittapath 2024-03-15 10:15:10 +07:00
parent 2529d7d43f
commit eeede05a30

View file

@ -1348,8 +1348,12 @@ export class SalaryPeriodController extends Controller {
*
*/
@Get("active")
async GetListsSalaryPeriodActive() {
const salaryPeriod = await AppDataSource.getRepository(SalaryPeriod)
async GetListsSalaryPeriodActive(
@Query("page") page: number = 1,
@Query("pageSize") pageSize: number = 10,
@Query("keyword") keyword?: string,
) {
const [salaryPeriod, total] = await AppDataSource.getRepository(SalaryPeriod)
.createQueryBuilder("salaryPeriod")
.where({ isActive: true })
.select([
@ -1363,9 +1367,11 @@ export class SalaryPeriodController extends Controller {
"salaryPeriod.revisionId",
])
.orderBy("salaryPeriod.effectiveDate", "DESC")
.getMany();
.skip((page - 1) * pageSize)
.take(pageSize)
.getManyAndCount();
return new HttpSuccess(salaryPeriod);
return new HttpSuccess({ data: salaryPeriod, total });
}
/**