Fix: use Contracts Finder search endpoint for notice URLs instead of broken /notice/ links

This commit is contained in:
Peter Foster
2026-02-14 18:11:02 +00:00
parent 61f498b967
commit ec56ef8cb8

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 || (sourceId ? 'https://www.contractsfinder.service.gov.uk/notice/' + sourceId.replace('ocds-b5fd17-', '') : ''); const noticeUrl = release.url || (sourceId ? 'https://www.contractsfinder.service.gov.uk/Published/Notices/OCDS/Search?query=' + encodeURIComponent(sourceId) : '');
const documentsUrl = tender.documents?.length > 0 ? tender.documents[0].url : ''; const documentsUrl = tender.documents?.length > 0 ? tender.documents[0].url : '';
// Extract value // Extract value