File tree Expand file tree Collapse file tree 5 files changed +45
-17
lines changed
Expand file tree Collapse file tree 5 files changed +45
-17
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,15 @@ export async function GET(request: Request) {
127127
128128 // Get total count before applying limit
129129 const total = await collection . countDocuments ( query ) ;
130-
130+
131131 const jobs = await cursor . toArray ( ) ;
132132
133- return NextResponse . json ( { jobs, total } , {
134- headers : { "Content-Type" : "application/json" } ,
135- } ) ;
133+ return NextResponse . json (
134+ { jobs, total } ,
135+ {
136+ headers : { "Content-Type" : "application/json" } ,
137+ } ,
138+ ) ;
136139 } catch ( error ) {
137140 console . error ( error ) ;
138141 return NextResponse . error ( ) ;
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ export default async function JobsPage({
1313 searchParams : Promise < Partial < JobFilters > > ;
1414} ) {
1515 const params = await searchParams ;
16-
16+
1717 // This try catch block can be removed once the app is stable
1818 // The console.log is only visible on the server (React server component thing)
19- let testJobDetails : Job | null = null ;
19+ let testJobDetails : Job | null = null ;
2020 try {
2121 const response = await fetchJobs ( params ) ;
2222 testJobDetails = response . jobs [ 0 ] ;
@@ -48,7 +48,6 @@ export default async function JobsPage({
4848 if ( testJobDetails ) {
4949 mockJobDetails = testJobDetails ;
5050 }
51-
5251
5352 return (
5453 < div className = "space-y-4" >
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ function sanitizeHtml(html: string) {
4141 return DOMPurify . sanitize ( html ) ;
4242}
4343
44- export default function JobDetails ( { job} : JobDetailsProps ) {
44+ export default function JobDetails ( { job } : JobDetailsProps ) {
4545 const handleApplyClick = ( ) => {
4646 window . open ( job . applicationUrl , "_blank" ) ; // Open link in a new tab
4747 } ;
Original file line number Diff line number Diff line change @@ -12,11 +12,13 @@ const PAGE_SIZE = 20; // Number of jobs per page
1212 * Fetches jobs from the API given a set of filters
1313 * This should not be manually called, rather done through the JobsPage component
1414 * See api/jobs/route.ts for the API implementation details
15- *
15+ *
1616 * @param filters - Filters to apply to the job search
1717 * @returns - A list of jobs and the total number of matching jobs
1818 */
19- export async function fetchJobs ( filters : Partial < JobFilters > ) : Promise < JobsApiResponse > {
19+ export async function fetchJobs (
20+ filters : Partial < JobFilters > ,
21+ ) : Promise < JobsApiResponse > {
2022 try {
2123 const baseUrl = process . env . NEXT_PUBLIC_BASE_URL || "http://localhost:3000" ;
2224 const url = new URL ( "/api/jobs" , baseUrl ) ;
@@ -52,16 +54,16 @@ export async function fetchJobs(filters: Partial<JobFilters>): Promise<JobsApiRe
5254 }
5355
5456 const response = await fetch ( url . toString ( ) ) ;
55-
57+
5658 if ( ! response . ok ) {
5759 throw new Error ( `HTTP error! status: ${ response . status } ` ) ;
5860 }
5961
60- const { jobs, total } = await response . json ( ) as JobsApiResponse ;
61-
62+ const { jobs, total } = ( await response . json ( ) ) as JobsApiResponse ;
63+
6264 return {
6365 jobs,
64- total
66+ total,
6567 } ;
6668 } catch ( error ) {
6769 console . error ( "Failed to fetch jobs:" , error ) ;
Original file line number Diff line number Diff line change 11// frontend/src/types/job.ts
22export type JobType = "EOI" | "FIRST_YEAR" | "INTERN" | "GRADUATE" | "OTHER" ;
3- export type LocationType = "VIC" | "NSW" | "QLD" | "WA" | "NT" | "SA" | "ACT" | "TAS" | "AUSTRALIA" | "OTHERS" ;
3+ export type LocationType =
4+ | "VIC"
5+ | "NSW"
6+ | "QLD"
7+ | "WA"
8+ | "NT"
9+ | "SA"
10+ | "ACT"
11+ | "TAS"
12+ | "AUSTRALIA"
13+ | "OTHERS" ;
414export type WFHStatus = "HYBRID" | "REMOTE" | "OFFICE" ;
5- export type WorkingRight = "AUS_CITIZEN" | "AUS_PR" | "NZ_CITIZEN" | "NZ_PR" | "INTERNATIONAL" | "WORK_VISA" | "VISA_SPONSORED" | "OTHER_RIGHTS" ;
6- export type IndustryField = "CONSULTING" | "BANKS" | "BIG_TECH" | "TECH" | "QUANT_TRADING" | "OTHER_INDUSTRY" ;
15+ export type WorkingRight =
16+ | "AUS_CITIZEN"
17+ | "AUS_PR"
18+ | "NZ_CITIZEN"
19+ | "NZ_PR"
20+ | "INTERNATIONAL"
21+ | "WORK_VISA"
22+ | "VISA_SPONSORED"
23+ | "OTHER_RIGHTS" ;
24+ export type IndustryField =
25+ | "CONSULTING"
26+ | "BANKS"
27+ | "BIG_TECH"
28+ | "TECH"
29+ | "QUANT_TRADING"
30+ | "OTHER_INDUSTRY" ;
731
832export interface Company {
933 name : string ;
You can’t perform that action at this time.
0 commit comments