Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from diygod:master #333

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/routes/hiring.cafe/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
Loading