Hi I am using below code to create pagination in nestjs/typeorm. is there any inbuilt library so that I dont have to do manual calculations.
const [employees,total] = await query.orderBy("employee.empNo", "ASC")
.take(take)
.skip((page - 1) * take)
.getManyAndCount();
return {
data: employees,
meta: {
total,
page,
last_page: Math.ceil(total/take)
}
}