This commit is contained in:
Rdeisenroth 2025-11-08 14:26:34 +01:00
parent 7c55fde138
commit ade5a91ec9
No known key found for this signature in database
GPG key ID: 197008FA42DE7127
2 changed files with 16 additions and 16 deletions

View file

@ -3,7 +3,7 @@ import { PrismaClient } from "@prisma/client";
import { execSync } from "node:child_process"; import { execSync } from "node:child_process";
// ensure db exists // ensure db exists
if(!fs.existsSync("./data/mydb.sqlite")) { if (!fs.existsSync("./data/mydb.sqlite")) {
// run bun prisma migrate deploy with child_process // run bun prisma migrate deploy with child_process
console.log("Database not found, creating a new one..."); console.log("Database not found, creating a new one...");
execSync("bun prisma migrate deploy"); execSync("bun prisma migrate deploy");

View file

@ -96,7 +96,7 @@ export const root = new Elysia().use(userService).get(
}, },
}); });
const { id } = await db.job.findFirst({ const { id } = (await db.job.findFirst({
where: { where: {
userId, userId,
}, },
@ -106,7 +106,7 @@ export const root = new Elysia().use(userService).get(
select: { select: {
id: true, id: true,
}, },
}) as { id: number }; })) as { id: number };
if (!jobId) { if (!jobId) {
return { message: "Cookies should be enabled to use this app." }; return { message: "Cookies should be enabled to use this app." };