Skip to content
Open
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
4 changes: 3 additions & 1 deletion web/netlify/functions/get-jobs/get-jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ exports.handler = async (event) => {

// IMPORTANT: Align this SELECT with your actual table columns.
// Based on what you showed, apply_link/url/country_code are NOT present in the table.
let where = "1=1";
let monthAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0];
let primaryIndustry = industries[0];
let where = `job_posted_date >= '${monthAgo}' AND country_code = '${escapeSqlString(countryCode)}' AND job_industries LIKE '%${escapeSqlString(primaryIndustry)}%'`;
if (countryCode) {
// Only apply this filter if your table actually has country_code.
// If it doesn't, remove this block or add the column to the table.
Expand Down