From 74ea8f5739bdf89e7a1b88285783d34179da2c49 Mon Sep 17 00:00:00 2001 From: Yunan Wang <77310871+mintyfrankie@users.noreply.github.com> Date: Mon, 30 Dec 2024 02:09:24 +0100 Subject: [PATCH] fix(hiringcafe): correct pubDate parsing (#18004) - Introduced `estimated_publish_date_millis` to `ProcessedJobData` interface. - Removed the old `estimated_publish_date` from `JobResult` interface. - Updated `transformJobItem` function to use the new `estimated_publish_date_millis` for publication date formatting. Signed-off-by: mintyfrankie <77310871+mintyfrankie@users.noreply.github.com> --- lib/routes/hiring.cafe/jobs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/hiring.cafe/jobs.ts b/lib/routes/hiring.cafe/jobs.ts index e902c4e58d1f1e..1e9a680cce6b51 100644 --- a/lib/routes/hiring.cafe/jobs.ts +++ b/lib/routes/hiring.cafe/jobs.ts @@ -39,6 +39,7 @@ interface ProcessedJobData { readonly job_category: string; readonly role_activities: readonly string[]; readonly formatted_workplace_location?: string; + readonly estimated_publish_date_millis: string; } interface JobResult { @@ -47,7 +48,6 @@ interface JobResult { readonly job_information: JobInformation; readonly v5_processed_job_data: ProcessedJobData; readonly _geoloc: readonly GeoLocation[]; - readonly estimated_publish_date: string; } interface ApiResponse { @@ -96,13 +96,13 @@ const renderJobDescription = (jobInfo: JobInformation, processedData: ProcessedJ }); const transformJobItem = (item: JobResult) => { - const { job_information: jobInfo, v5_processed_job_data: processedData, estimated_publish_date, apply_url, id } = item; + const { job_information: jobInfo, v5_processed_job_data: processedData, apply_url, id } = item; return { title: `${jobInfo.title} - ${processedData.company_name}`, description: renderJobDescription(jobInfo, processedData), link: apply_url, - pubDate: new Date(estimated_publish_date).toUTCString(), + pubDate: new Date(processedData.estimated_publish_date_millis).toUTCString(), category: [processedData.job_category, ...processedData.role_activities, processedData.workplace_type].filter((x): x is string => !!x), author: processedData.company_name, guid: id,