fix: resolve merge conflict markers in ApiJob interface and fix requirements type handling
Removed leftover <<<<<<< Updated upstream conflict markers that were breaking TypeScript compilation, preventing the job detail page (/jobs/[id]) from loading real data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ae4dcb4b90
commit
f6758c165c
1 changed files with 10 additions and 8 deletions
|
|
@ -84,7 +84,6 @@ export interface ApiJob {
|
|||
companyName?: string;
|
||||
companyLogoUrl?: string;
|
||||
companyId: string;
|
||||
<<<<<<< Updated upstream
|
||||
location?: string | null;
|
||||
type?: string; // Legacy alias
|
||||
employmentType?: string;
|
||||
|
|
@ -94,7 +93,6 @@ export interface ApiJob {
|
|||
salaryType?: string;
|
||||
currency?: string;
|
||||
description: string;
|
||||
<<<<<<< Updated upstream
|
||||
requirements?: unknown;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
|
|
@ -586,6 +584,9 @@ export const storageApi = {
|
|||
export function transformApiJobToFrontend(apiJob: ApiJob): Job {
|
||||
let reqs: string[] = [];
|
||||
if (apiJob.requirements) {
|
||||
if (Array.isArray(apiJob.requirements)) {
|
||||
reqs = apiJob.requirements.map(String).filter(Boolean);
|
||||
} else if (typeof apiJob.requirements === 'string') {
|
||||
if (apiJob.requirements.startsWith('[')) {
|
||||
try {
|
||||
reqs = JSON.parse(apiJob.requirements);
|
||||
|
|
@ -596,6 +597,7 @@ export function transformApiJobToFrontend(apiJob: ApiJob): Job {
|
|||
reqs = apiJob.requirements.split('\n').filter(Boolean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let salaryLabel: string | undefined;
|
||||
if (apiJob.salaryMin && apiJob.salaryMax) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue