mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 08:36:25 +00:00
fix(jobindex-search): map ASAP deadlines to null per the /scrape contract
apply_deadline_asap was emitted as the string "ASAP" on ~half of live results - undocumented, contradicting the CLI's own README, and breaking every consumer that does date arithmetic on the field (rank's sweep, outcome's deadline check, notion-sync's typed date column). ASAP means "no stated deadline", which the schema already defines null to mean. The flag wins over any date field that happens to be present. Review finding F12 (2026-08-19), decision approved by Mads. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
2edf8c41f1
commit
b067928da7
@@ -160,7 +160,11 @@ export function parseSearchPage(html: string): SearchPageResult {
|
||||
}
|
||||
}
|
||||
let deadline: string | null = null
|
||||
if (r.apply_deadline_asap) deadline = "ASAP"
|
||||
// apply_deadline_asap means the posting states no fixed deadline ("apply
|
||||
// now"). The /scrape contract represents that as null, and consumers do
|
||||
// date arithmetic on this field - so the flag maps to null, and wins over
|
||||
// any date field that happens to be present.
|
||||
if (r.apply_deadline_asap) deadline = null
|
||||
else if (typeof r.apply_deadline === "string") deadline = r.apply_deadline.slice(0, 10)
|
||||
else if (typeof r.lastdate === "string") deadline = r.lastdate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user