Skip to main content

Lever

useEffect(() => {
const fetchData = async () => {
const response = await fetch(
"https://api.lever.co/v0/postings/canopyservicing?mode=json"
);

const data = await response.json();
setJobs(data);

setUniqueCountries(
Array.from(
new Set(
data.map((job) => job.country).filter((country) => country !== null)
)
)
);
setUniqueDepartments(
Array.from(
new Set(
jobs
.map((job) => job.categories.department)
.filter(
(department) => department !== null && department !== undefined
)
)
)
);
};

fetchData();
}, []);