diff --git a/web/netlify/functions/get-jobs/get-jobs.js b/web/netlify/functions/get-jobs/get-jobs.js index 94204b7..14ab733 100755 --- a/web/netlify/functions/get-jobs/get-jobs.js +++ b/web/netlify/functions/get-jobs/get-jobs.js @@ -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.