Skip to content

Commit

Permalink
Fix Pagination error (code100x#261)
Browse files Browse the repository at this point in the history
* Fix Pagination error

* Fix prettier format
  • Loading branch information
prateekkumaroriginal authored Aug 27, 2024
1 parent fb79dba commit 035ddba
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/app/jobs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@ import Loader from '@/components/loader';
import APP_PATHS from '@/config/path.config';
import JobFilters from '@/layouts/job-filters';
import JobsHeader from '@/layouts/jobs-header';
import { JobQuerySchemaType } from '@/lib/validators/jobs.validator';
import {
JobQuerySchema,
JobQuerySchemaType,
} from '@/lib/validators/jobs.validator';
import { Suspense } from 'react';

const page = async ({ searchParams }: { searchParams: JobQuerySchemaType }) => {
const validatedSearchParams = JobQuerySchema.parse(searchParams);

return (
<div className="container flex gap-5 pt-10">
<JobFilters searchParams={searchParams} baseUrl={APP_PATHS.JOBS} />
<div className="container flex gap-5 pt-5">
<JobFilters
searchParams={validatedSearchParams}
baseUrl={APP_PATHS.JOBS}
/>
<div className="grow">
<JobsHeader searchParams={searchParams} baseUrl={APP_PATHS.JOBS} />
<JobsHeader
searchParams={validatedSearchParams}
baseUrl={APP_PATHS.JOBS}
/>
<Suspense
fallback={
<div className="flex justify-center items-center h-full gap-5 ">
<Loader />
</div>
}
>
<AllJobs searchParams={searchParams} />
<AllJobs searchParams={validatedSearchParams} />
</Suspense>
</div>
</div>
Expand Down

0 comments on commit 035ddba

Please sign in to comment.