Fix: use direct notice URLs for Contracts Finder and Sell2Wales instead of search fallbacks

This commit is contained in:
Peter Foster
2026-02-14 18:33:12 +00:00
parent 6c1a649455
commit 1be6a2531e
2 changed files with 2 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ async function scrapeTenders() {
if (deadline && new Date(deadline) < new Date()) continue; if (deadline && new Date(deadline) < new Date()) continue;
const authority = procurer?.name || 'Unknown'; const authority = procurer?.name || 'Unknown';
const location = planning?.budget?.description || tender.procurementMethod || ''; const location = planning?.budget?.description || tender.procurementMethod || '';
const noticeUrl = release.url || 'https://www.contractsfinder.service.gov.uk/Search'; const noticeUrl = release.url || ('https://www.contractsfinder.service.gov.uk/notice/' + sourceId.replace('ocds-b5fd17-', ''));
const documentsUrl = tender.documents?.length > 0 ? tender.documents[0].url : ''; const documentsUrl = tender.documents?.length > 0 ? tender.documents[0].url : '';
// Extract value // Extract value

View File

@@ -67,7 +67,7 @@ async function scrapeTenders() {
const title = link.text().trim(); const title = link.text().trim();
if (!title || title.length === 0) continue; if (!title || title.length === 0) continue;
const noticeUrl = href.startsWith('http') ? href : 'https://www.sell2wales.gov.wales' + href; const noticeUrl = release.url || ('https://sell2wales.gov.wales/Search/notice/' + sourceId);
// Get the parent container for this tender // Get the parent container for this tender
const container = link.closest('div, li, tr'); const container = link.closest('div, li, tr');