From a786757468e2c5bc54665ceb63083f348d81f500 Mon Sep 17 00:00:00 2001 From: Graeme Fulton Date: Tue, 30 Apr 2024 23:59:31 +0100 Subject: [PATCH] fix revalidate tool --- pages/api/revalidate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/api/revalidate.js b/pages/api/revalidate.js index 5af127bf..42d5fcc3 100644 --- a/pages/api/revalidate.js +++ b/pages/api/revalidate.js @@ -9,6 +9,7 @@ export default async function handler(req, res) { try { const { entry } = req.body; + console.log(req.body) // revalidate posts if (entry.type=='article' && (entry.status === "publish" || entry.publishedAt)) { console.log("revalidating published post :", entry.slug); @@ -17,7 +18,7 @@ export default async function handler(req, res) { return res.json({ revalidated: true }); } //revalidate jobs - else if(entry.publishedAt){ + else if(entry.type=='job' && entry.publishedAt){ console.log("revalidating job post :", entry.slug); const url = `/jobs/${entry.id}`; await res.revalidate(url);