upd: diskusi

Deskripsi:
- load scroll deskripsi

No Issues
This commit is contained in:
amel
2024-09-19 17:38:26 +08:00
parent 50355a963d
commit f5816e7bd2
3 changed files with 49 additions and 13 deletions

View File

@@ -18,6 +18,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) {
@@ -33,6 +35,8 @@ export async function GET(request: Request) {
}
const data = await prisma.divisionDisscussion.findMany({
skip: dataSkip,
take: 10,
where: {
isActive: true,
idDivision: idDivision,

View File

@@ -21,7 +21,7 @@ export async function GET(request: Request) {
const divisi = searchParams.get('division');
const status = searchParams.get('status');
const page = searchParams.get('page');
const dataSkip = Number(page) * 3 - 3;
const dataSkip = Number(page) * 10 - 10;
const cek = await prisma.division.count({
where: {
@@ -36,7 +36,7 @@ export async function GET(request: Request) {
const data = await prisma.divisionProject.findMany({
skip: dataSkip,
take: 3,
take: 10,
where: {
isActive: true,
idDivision: String(divisi),