Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/src/app/jobs/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ export async function getJobs(
: [array_jobs["industryFields[]"]],
},
}),
...(array_jobs["jobTypes[]"] !== undefined &&
array_jobs["jobTypes[]"].length && {
type: {
$in: Array.isArray(array_jobs["jobTypes[]"])
? array_jobs["jobTypes[]"]
: [array_jobs["jobTypes[]"]],
},
}),
...(filters.search && {
$or: [
{ title: { $regex: filters.search, $options: "i" } },
Expand Down
12 changes: 11 additions & 1 deletion frontend/src/components/jobs/filters/filter-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import { Text } from "@mantine/core";
import { useFilterContext } from "@/context/filter/filter-context";
import DropdownFilter from "@/components/jobs/filters/dropdown-filter";
import { INDUSTRY_FIELDS, LOCATIONS, WORKING_RIGHTS } from "@/types/job";
import {
INDUSTRY_FIELDS,
JOB_TYPES,
LOCATIONS,
WORKING_RIGHTS,
} from "@/types/job";
import { useEffect } from "react";

interface FilterSectionProps {
Expand Down Expand Up @@ -36,6 +41,11 @@ export default function FilterSection({ _totalJobs }: FilterSectionProps) {
filterKey="workingRights"
options={[...WORKING_RIGHTS]}
/>
<DropdownFilter
label="Job Type"
filterKey="jobTypes"
options={[...JOB_TYPES]}
/>
</div>
{/*<DropdownSort />*/}
</div>
Expand Down