From 957b0e485ce67d298ec3188e4866716225c00221 Mon Sep 17 00:00:00 2001 From: amamc Date: Tue, 21 May 2024 22:35:11 -0700 Subject: [PATCH] Updated the route --- src/app/api/job-posting/route.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/api/job-posting/route.js b/src/app/api/job-posting/route.js index e42a329..7869958 100644 --- a/src/app/api/job-posting/route.js +++ b/src/app/api/job-posting/route.js @@ -3,6 +3,7 @@ import { connectMongoDB } from '@/libs/mongodb'; import posting from '@/app/api/posting'; import mongoose from 'mongoose'; import { + getPaginationParams, fetchJobPostings, parseSortCriteria, parseFilterCriteria, @@ -10,6 +11,7 @@ import { export async function GET(req) { try { + const { skip, pageSize } = getPaginationParams(req); const email = req.nextUrl.searchParams.get('email'); const sortBy = req.nextUrl.searchParams.get('sort'); const etFilters = req.nextUrl.searchParams.getAll('et'); @@ -27,8 +29,6 @@ export async function GET(req) { } const siteCriteria = { email }; - const skip = 0; - const pageSize = 0; // Query job postings with pagination and sort criteria if provided const jobPostings = await fetchJobPostings(