fix(lint): add version to drizzle-orm imports and prefix unused NOT_FOUND

This commit is contained in:
2026-04-26 00:24:27 +02:00
committed by djalim
parent cdd9c0bf06
commit 6db04045f4
20 changed files with 880 additions and 82 deletions
+14 -6
View File
@@ -1,10 +1,10 @@
import { Handlers } from "$fresh/server.ts";
import { db } from "../../../../databases/db.ts";
import { ueModules } from "../../../../databases/schema.ts";
import { and, eq } from "npm:drizzle-orm";
import { and, eq } from "npm:drizzle-orm@0.45.2";
export const handler: Handlers = {
// #37 GET /ue-modules
// #37 GET /ue-modules
async GET(request) {
try {
const url = new URL(request.url);
@@ -33,7 +33,7 @@ export const handler: Handlers = {
return new Response("Failed to fetch data", { status: 500 });
}
},
// #38 POST /ue-modules
async POST(request) {
try {
@@ -41,10 +41,18 @@ export const handler: Handlers = {
const { idModule, idUE, idPromo, coeff } = body;
if (!idModule || !idUE || !idPromo || coeff === undefined) {
return new Response("Champs 'idModule', 'idUE', 'idPromo' et 'coeff' requis", { status: 400 });
return new Response(
"Champs 'idModule', 'idUE', 'idPromo' et 'coeff' requis",
{ status: 400 },
);
}
const result = await db.insert(ueModules).values({ idModule, idUE, idPromo, coeff }).returning();
const result = await db.insert(ueModules).values({
idModule,
idUE,
idPromo,
coeff,
}).returning();
return new Response(JSON.stringify(result[0]), {
status: 201,
@@ -55,4 +63,4 @@ export const handler: Handlers = {
return new Response("Failed to create UE-module", { status: 500 });
}
},
};
};