Skip to content

Commit 222e94e

Browse files
authored
chore: add approvals check for job posting (#220)
1 parent 805db84 commit 222e94e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/_data/jobData.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ async function fetchJobPostings(URL) {
2929
location: row.c[8]?.v || "Unknown",
3030
description: row.c[7]?.v || "No description available",
3131
link_to_apply: ensureHttps(row.c[9]?.v) || "#",
32+
approved: row.c[12]?.v || false,
3233
}))
3334
.filter((job_post) =>
3435
isValidUrl(job_post.company_website) &&
3536
isValidUrl(job_post.link_to_apply)
3637
);
37-
38+
3839
return jobPostings;
3940
} catch (error) {
4041
console.error("Error fetching or processing job postings:", error);

src/attend/jobs.njk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ layout: base.njk
2626
</div>
2727

2828

29-
<div class="job-container bg-lavender w-full h-auto {% if job_postings %} px-[6%] -pt-20 pb-72 md:pb-40 relative {% else %} p-0 {% endif %}">
30-
{% if job_postings %}
29+
<div class="job-container bg-lavender w-full h-auto {% if job_postings|length > 0 %} px-[6%] -pt-20 pb-72 md:pb-40 relative {% else %} p-0 {% endif %}">
30+
{% if job_postings|length > 0 %}
3131
<div class="flex flex-wrap -mt-24">
3232
<!-- Column 1 -->
3333
<div class="w-full lg:w-1/3 px-4 flex flex-col gap-8">
3434
{% for job_post in job_postings %}
35-
{% if loop.index0 % 3 == 0 %}
35+
{% if loop.index0 % 3 == 0 and job_post.approved %}
3636
{% set bg_color = 'purple' if loop.index0 // 3 % 2 == 0 else 'lime' %}
3737
{% call flatCard(bg=bg_color) -%}
3838
<div class="p-4">
@@ -65,7 +65,7 @@ layout: base.njk
6565
<!-- Column 2 -->
6666
<div class="w-full pt-8 lg:pt-16 lg:w-1/3 px-4 flex flex-col gap-8">
6767
{% for job_post in job_postings %}
68-
{% if loop.index0 % 3 == 1 %}
68+
{% if loop.index0 % 3 == 1 and job_post.approved %}
6969
{% set bg_color = 'purple' if loop.index0 // 3 % 2 == 1 else 'lime' %}
7070
{% call flatCard(bg=bg_color) -%}
7171
<div class="p-4">
@@ -98,7 +98,7 @@ layout: base.njk
9898
<!-- Column 3 -->
9999
<div class="w-full pt-8 lg:pt-0 lg:w-1/3 px-4 flex flex-col gap-8">
100100
{% for job_post in job_postings %}
101-
{% if loop.index0 % 3 == 2 %}
101+
{% if loop.index0 % 3 == 2 and job_post.approved %}
102102
{% set bg_color = 'purple' if loop.index0 // 3 % 2 == 0 else 'lime' %}
103103
{% call flatCard(bg=bg_color) -%}
104104
<div class="p-4">

0 commit comments

Comments
 (0)