diff --git a/src/components/all-jobs.tsx b/src/components/all-jobs.tsx index 4a5f8f2c..c56cf403 100644 --- a/src/components/all-jobs.tsx +++ b/src/components/all-jobs.tsx @@ -10,6 +10,7 @@ import { Pagination, PaginationContent, PaginationItem } from './ui/pagination'; import { PaginationPages } from './ui/paginator'; import JobCard from './Jobcard'; import APP_PATHS from '@/config/path.config'; +import { redirect } from 'next/navigation'; type PaginatorProps = { searchParams: JobQuerySchemaType; @@ -23,6 +24,10 @@ const AllJobs = async ({ searchParams }: PaginatorProps) => { const userbookmarkArr: { jobId: string }[] | null = getUserBookmarks.data; + if (jobs.code === 401) { + redirect('/signin'); + } + if (!jobs.status || !jobs.additional) { return
Error {jobs.message}
; }