diff --git a/routes/(apps)/notes/api/ue-modules.ts b/routes/(apps)/notes/api/ue-modules.ts index ba56b66..6106d18 100644 --- a/routes/(apps)/notes/api/ue-modules.ts +++ b/routes/(apps)/notes/api/ue-modules.ts @@ -4,36 +4,6 @@ import { ueModules } from "../../../../databases/schema.ts"; import { and, eq } from "npm:drizzle-orm"; export const handler: Handlers = { - // #37 GET /ue-modules - async GET(request) { - try { - const url = new URL(request.url); - const idPromo = url.searchParams.get("idPromo"); - const idUEParam = url.searchParams.get("idUE"); - - const idUE = idUEParam ? parseInt(idUEParam) : null; - - if (idUEParam && isNaN(idUE!)) { - return new Response("Paramètre idUE invalide", { status: 400 }); - } - - const result = await db.select().from(ueModules).where( - and( - idPromo ? eq(ueModules.idPromo, idPromo) : undefined, - idUE ? eq(ueModules.idUE, idUE) : undefined, - ), - ); - - return new Response(JSON.stringify(result), { - status: 200, - headers: { "Content-Type": "application/json" }, - }); - } catch (error) { - console.error("Error fetching UE-modules:", error); - return new Response("Failed to fetch data", { status: 500 }); - } - }, - // #38 POST /ue-modules async POST(request) { try {