Skip to content

Commit d41adcb

Browse files
committed
chore: run prettier
1 parent 455fb07 commit d41adcb

File tree

5 files changed

+45
-17
lines changed

5 files changed

+45
-17
lines changed

frontend/src/app/api/jobs/route.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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();

frontend/src/app/jobs/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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">

frontend/src/components/jobs/details/job-details.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
};

frontend/src/lib/fetch-jobs.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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);

frontend/src/types/job.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
// frontend/src/types/job.ts
22
export 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";
414
export 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

832
export interface Company {
933
name: string;

0 commit comments

Comments
 (0)