Skip to content

Commit 022d2b7

Browse files
committed
merge conflicts resolve
2 parents d65760e + 80d0ae6 commit 022d2b7

File tree

17 files changed

+3338
-1682
lines changed

17 files changed

+3338
-1682
lines changed

app/api/evaluations/[id]/route.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,5 @@
11
import { NextRequest, NextResponse } from "next/server";
22
import { apiClient } from "@/app/lib/apiClient";
3-
import fs from "fs";
4-
import path from "path";
5-
6-
// Set to true to use mock data, false to use real backend
7-
const USE_MOCK_DATA = false;
8-
9-
// === MOCK DATA (remove this section when no longer needed) ===
10-
const MOCK_FILE_MAP: Record<string, string> = {
11-
"44": "evaluation-sample-2.json",
12-
"2": "evaluation-sample-2.json",
13-
"10": "evaluation-sample-3.json",
14-
"3": "evaluation-sample-3.json",
15-
};
16-
17-
function getMockEvaluation(id: string): NextResponse {
18-
const mockFileName = MOCK_FILE_MAP[id] || "evaluation-sample-1.json";
19-
const filePath = path.join(
20-
process.cwd(),
21-
"public",
22-
"mock-data",
23-
mockFileName,
24-
);
25-
26-
try {
27-
const fileContent = fs.readFileSync(filePath, "utf-8");
28-
const mockData = JSON.parse(fileContent);
29-
return NextResponse.json(mockData, { status: 200 });
30-
} catch (err) {
31-
console.error("Error reading mock data:", err);
32-
return NextResponse.json(
33-
{
34-
error: "Mock data not found",
35-
details: err instanceof Error ? err.message : String(err),
36-
},
37-
{ status: 404 },
38-
);
39-
}
40-
}
413

424
/**
435
* GET /api/evaluations/[id]
@@ -50,10 +12,6 @@ export async function GET(
5012
try {
5113
const { id } = await params;
5214

53-
if (USE_MOCK_DATA) {
54-
return getMockEvaluation(id);
55-
}
56-
5715
const searchParams = request.nextUrl.searchParams;
5816
const exportFormat = searchParams.get("export_format") || "row";
5917
const resyncScore = searchParams.get("resync_score") || "false";

app/components/ConfigCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import React, { useState } from 'react';
99
import { useRouter } from 'next/navigation';
1010
import { colors } from '@/app/lib/colors';
11-
import { ConfigGroup, SavedConfig, formatRelativeTime } from '@/app/lib/useConfigs';
11+
import { ConfigGroup, SavedConfig } from '@/app/lib/types/configs';
12+
import { formatRelativeTime } from '@/app/lib/utils';
1213

1314
interface ConfigCardProps {
1415
configGroup: ConfigGroup;

0 commit comments

Comments
 (0)