Update Next.js configuration for standalone output; add type checking script to package.json; enhance Prisma schema with binary targets; modify authentication API to only require email; improve evaluation detail page with Link component; add ESLint directive in new evaluation page; adjust theme provider for state setting; refine export-utils test type assertion.

This commit is contained in:
Julien Froidefond
2026-02-20 09:35:22 +01:00
parent 9fcceb2649
commit 678517aee0
15 changed files with 149 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ const MOCK_ADMIN = {
export async function POST(req: NextRequest) {
try {
const body = await req.json();
const { email, password } = body;
const { email } = body;
// Accept any email for MVP; in prod validate against DB
if (!email) {

View File

@@ -1,6 +1,7 @@
"use client";
import { useState, useEffect, useCallback } from "react";
import Link from "next/link";
import { useParams, useRouter } from "next/navigation";
import { CandidateForm } from "@/components/CandidateForm";
import { DimensionCard } from "@/components/DimensionCard";
@@ -70,10 +71,10 @@ export default function EvaluationDetailPage() {
if (evalData?.template?.dimensions?.length > 0 && Array.isArray(templatesData)) {
const tmpl = templatesData.find((t: { id: string }) => t.id === evalData.templateId);
if (tmpl?.dimensions?.length) {
const dimMap = new Map(tmpl.dimensions.map((d: { id: string }) => [d.id, d]));
const dimMap = new Map(tmpl.dimensions.map((d: { id: string; suggestedQuestions?: string | null }) => [d.id, d]));
evalData.template.dimensions = evalData.template.dimensions.map((d: { id: string; suggestedQuestions?: string | null }) => ({
...d,
suggestedQuestions: d.suggestedQuestions ?? dimMap.get(d.id)?.suggestedQuestions,
suggestedQuestions: d.suggestedQuestions ?? (dimMap.get(d.id) as { suggestedQuestions?: string | null } | undefined)?.suggestedQuestions,
}));
}
}
@@ -187,9 +188,9 @@ export default function EvaluationDetailPage() {
return (
<div className="py-12 text-center font-mono text-xs text-zinc-600 dark:text-zinc-500">
Évaluation introuvable.{" "}
<a href="/" className="text-cyan-600 dark:text-cyan-400 hover:underline">
<Link href="/" className="text-cyan-600 dark:text-cyan-400 hover:underline">
dashboard
</a>
</Link>
</div>
);
}

View File

@@ -28,6 +28,7 @@ export default function NewEvaluationPage() {
}
})
.finally(() => setLoading(false));
// eslint-disable-next-line react-hooks/exhaustive-deps -- run once on mount to fetch templates and set initial templateId
}, []);
const handleSubmit = async (e: React.FormEvent) => {

View File

@@ -20,8 +20,10 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
const stored = localStorage.getItem("theme") as Theme | null;
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
const initial = stored ?? (prefersDark ? "dark" : "light");
setThemeState(initial);
setMounted(true);
queueMicrotask(() => {
setThemeState(initial);
setMounted(true);
});
}, []);
useEffect(() => {

View File

@@ -79,7 +79,7 @@ describe("evaluationToCsvRows", () => {
confidence: "high",
},
],
} as Parameters<typeof evaluationToCsvRows>[0];
} as unknown as Parameters<typeof evaluationToCsvRows>[0];
const rows = evaluationToCsvRows(evalData);
expect(rows[0]).toContain("candidateName");