Skip to content

Commit 57f51e7

Browse files
committed
Merge branch 'main' of https://github.com/ProjectTech4DevAI/kaapi-frontend into feat/implement-prettier-formatting
2 parents a6384e6 + 8076d1f commit 57f51e7

File tree

18 files changed

+2727
-1326
lines changed

18 files changed

+2727
-1326
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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
import { useState } from "react";
1010
import { useRouter } from "next/navigation";
1111
import { colors } from "@/app/lib/colors";
12-
import {
13-
ConfigGroup,
14-
SavedConfig,
15-
formatRelativeTime,
16-
} from "@/app/lib/useConfigs";
12+
import { ConfigGroup, SavedConfig } from "@/app/lib/types/configs";
13+
import { formatRelativeTime } from "@/app/lib/utils";
1714

1815
interface ConfigCardProps {
1916
configGroup: ConfigGroup;

0 commit comments

Comments
 (0)