File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { handleError } from "@/lib/utils";
44import { AddJobFormSchema } from "@/models/addJobForm.schema" ;
55import { JobStatus } from "@/models/job.model" ;
66import { getCurrentUser } from "@/utils/user.utils" ;
7+ import { revalidatePath } from "next/cache" ;
78import { z } from "zod" ;
89
910export const getStatusList = async ( ) : Promise < any | undefined > => {
Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ function JobDetails({ job }: { job: JobResponse }) {
2424 const getAiJobMatch = async ( ) => {
2525 setAiSectionOpen ( true ) ;
2626 } ;
27+ const getJobType = ( code : string ) => {
28+ switch ( code ) {
29+ case "FT" :
30+ return "Full-time" ;
31+ case "PT" :
32+ return "Part-time" ;
33+ case "C" :
34+ return "Contract" ;
35+ default :
36+ return "Unknown" ;
37+ }
38+ } ;
2739 return (
2840 < >
2941 < div className = "flex justify-between" >
@@ -49,7 +61,7 @@ function JobDetails({ job }: { job: JobResponse }) {
4961 { job ?. Company ?. label }
5062 < CardTitle > { job ?. JobTitle ?. label } </ CardTitle >
5163 < CardDescription >
52- { job ?. Location ?. label } - { job ?. jobType }
64+ { job ?. Location ?. label } - { getJobType ( job ?. jobType ) }
5365 </ CardDescription >
5466 </ CardHeader >
5567 < h3 className = "ml-4" >
@@ -67,7 +79,7 @@ function JobDetails({ job }: { job: JobResponse }) {
6779 </ Badge >
6880 ) }
6981 < span className = "ml-2" >
70- { format ( new Date ( job ?. appliedDate ) , "PP" ) }
82+ { job ?. appliedDate ? format ( new Date ( job ?. appliedDate ) , "PP" ) : "" }
7183 </ span >
7284 </ h3 >
7385 { job . jobUrl && (
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ function JobsContainer({
142142 const onChangeJobStatus = async ( jobId : string , jobStatus : JobStatus ) => {
143143 const { success, message } = await updateJobStatus ( jobId , jobStatus ) ;
144144 if ( success ) {
145+ router . refresh ( ) ;
145146 toast ( {
146147 variant : "success" ,
147148 description : `Job has been updated successfully` ,
You can’t perform that action at this time.
0 commit comments