start migrationg to prisma-orm
This commit is contained in:
parent
9a8d7a36b9
commit
ae2cd5e61f
18 changed files with 374 additions and 200 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue