start migrationg to prisma-orm

This commit is contained in:
Rdeisenroth 2025-11-06 22:53:08 +01:00
parent 9a8d7a36b9
commit ae2cd5e61f
No known key found for this signature in database
GPG key ID: 197008FA42DE7127
18 changed files with 374 additions and 200 deletions

View file

@ -12,9 +12,12 @@ export const deleteFile = new Elysia().use(userService).post(
return redirect(`${WEBROOT}/`, 302);
}
const existingJob = await db
.query("SELECT * FROM jobs WHERE id = ? AND user_id = ?")
.get(jobId.value, user.id);
const existingJob = await db.job.findFirst({
where: {
id: parseInt(jobId.value, 10),
userId: parseInt(user.id, 10),
},
});
if (!existingJob) {
return redirect(`${WEBROOT}/`, 302);