Remove unused components, change zod to v4 and cahnge a few character properties

This commit is contained in:
Clément Pons
2025-08-26 13:21:42 +02:00
parent 5387dc66c3
commit 80a94bee86
60 changed files with 170 additions and 2742 deletions

View File

@@ -1,5 +1,5 @@
import { and, count, eq } from 'drizzle-orm';
import { z } from 'zod';
import { eq } from 'drizzle-orm';
import { z } from 'zod/v4';
import { usersTable } from '~/db/schema';
import { schema as registration } from '~/schemas/registration';
import useDatabase from '~/composables/useDatabase';
@@ -54,12 +54,12 @@ export default defineEventHandler(async (e) => {
message: 'Unauthorized',
});
}
if(!await Bun.password.verify(body.data.oldPassword, check.hash))
if(!await Bun.password.verify(body.data.oldPassword as string, check.hash))
{
return { success: false, error: "Ancien mot de passe incorrect" };
}
db.update(usersTable).set({ hash: await Bun.password.hash(body.data.newPassword) }).where(eq(usersTable.id, session.user.id)).run();
db.update(usersTable).set({ hash: await Bun.password.hash(body.data.newPassword as string) }).where(eq(usersTable.id, session.user.id)).run();
return { success: true };
}

View File

@@ -1,5 +1,5 @@
import { eq, getTableColumns, lte } from 'drizzle-orm';
import { z } from 'zod';
import { z } from 'zod/v4';
import useDatabase from '~/composables/useDatabase';
import { emailValidationTable, usersTable } from '~/db/schema';