upd: calender

Deskripsi:
- update scroll load history

No Issues
This commit is contained in:
amel
2024-09-27 11:08:56 +08:00
parent 3f85acc3fd
commit 8fbfe17200
2 changed files with 58 additions and 11 deletions

View File

@@ -16,6 +16,8 @@ export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
const idDivision = searchParams.get("division");
const name = searchParams.get('search');
const page = searchParams.get('page');
const dataSkip = Number(page) * 10 - 10;
if (idDivision != "null" && idDivision != null && idDivision != undefined) {
const cekDivision = await prisma.division.count({
@@ -30,6 +32,8 @@ export async function GET(request: Request) {
}
const data = await prisma.divisionCalendarReminder.findMany({
skip: dataSkip,
take: 10,
where: {
isActive: true,
idDivision: idDivision,