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;
|
companyName?: string;
|
||||||
companyLogoUrl?: string;
|
companyLogoUrl?: string;
|
||||||
companyId: string;
|
companyId: string;
|
||||||
<<<<<<< Updated upstream
|
|
||||||
location?: string | null;
|
location?: string | null;
|
||||||
type?: string; // Legacy alias
|
type?: string; // Legacy alias
|
||||||
employmentType?: string;
|
employmentType?: string;
|
||||||
|
|
@ -94,7 +93,6 @@ export interface ApiJob {
|
||||||
salaryType?: string;
|
salaryType?: string;
|
||||||
currency?: string;
|
currency?: string;
|
||||||
description: string;
|
description: string;
|
||||||
<<<<<<< Updated upstream
|
|
||||||
requirements?: unknown;
|
requirements?: unknown;
|
||||||
status: string;
|
status: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
|
@ -586,6 +584,9 @@ export const storageApi = {
|
||||||
export function transformApiJobToFrontend(apiJob: ApiJob): Job {
|
export function transformApiJobToFrontend(apiJob: ApiJob): Job {
|
||||||
let reqs: string[] = [];
|
let reqs: string[] = [];
|
||||||
if (apiJob.requirements) {
|
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('[')) {
|
if (apiJob.requirements.startsWith('[')) {
|
||||||
try {
|
try {
|
||||||
reqs = JSON.parse(apiJob.requirements);
|
reqs = JSON.parse(apiJob.requirements);
|
||||||
|
|
@ -596,6 +597,7 @@ export function transformApiJobToFrontend(apiJob: ApiJob): Job {
|
||||||
reqs = apiJob.requirements.split('\n').filter(Boolean);
|
reqs = apiJob.requirements.split('\n').filter(Boolean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let salaryLabel: string | undefined;
|
let salaryLabel: string | undefined;
|
||||||
if (apiJob.salaryMin && apiJob.salaryMax) {
|
if (apiJob.salaryMin && apiJob.salaryMax) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue