chore(deps): update drizzle-orm to 0.45.2 and pg to 8.20.0

This commit is contained in:
2026-04-22 14:23:34 +02:00
parent 2c1fd7e5ad
commit 6c18189d9f
12 changed files with 49 additions and 25 deletions
+10 -3
View File
@@ -2,7 +2,7 @@ import { FreshContext, Handlers } from "$fresh/server.ts";
import { db } from "$root/databases/db.ts";
import { users } from "$root/databases/schema.ts";
import { AuthenticatedState } from "$root/defaults/interfaces.ts";
import { eq } from "npm:drizzle-orm";
import { eq } from "npm:drizzle-orm@0.45.2";
export const handler: Handlers<null, AuthenticatedState> = {
// #60 GET /users
@@ -42,14 +42,21 @@ export const handler: Handlers<null, AuthenticatedState> = {
if (existing) {
return new Response(
JSON.stringify({ error: "Un utilisateur avec cet identifiant existe déjà" }),
JSON.stringify({
error: "Un utilisateur avec cet identifiant existe déjà",
}),
{ status: 409, headers: { "content-type": "application/json" } },
);
}
const [created] = await db
.insert(users)
.values({ id: body.id, nom: body.nom, prenom: body.prenom, idRole: body.idRole })
.values({
id: body.id,
nom: body.nom,
prenom: body.prenom,
idRole: body.idRole,
})
.returning();
return new Response(JSON.stringify(created), {