mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
update
This commit is contained in:
@ -38,14 +38,14 @@
|
||||
alert("Invalid URL.");
|
||||
return;
|
||||
}
|
||||
const response = await fetch(`${API_URL}/organization/${idToDisplay}`, {
|
||||
const response = await fetch(`${API_URL}/organizations/${idToDisplay}`, {
|
||||
headers: {
|
||||
"Content-type": "application/json; charset=UTF-8",
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
if (response.ok) {
|
||||
populateFields(data.name, data.location, data.description, data.is_hiring);
|
||||
populateFields(data.name, data.location, data.description, isOrganizationHiring(idToDisplay));
|
||||
document.body.style.display = "block"; // Show page
|
||||
} else {
|
||||
alert(data.error);
|
||||
@ -67,6 +67,16 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function isOrganizationHiring(organizationId) {
|
||||
const response = await fetch(`${API_URL}/organizations/${organizationId}/joboffers`, {
|
||||
headers: {
|
||||
"Content-type": "application/json; charset=UTF-8",
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
return data.length > 0;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user