Fix tsc errors
This commit is contained in:
@@ -179,7 +179,7 @@ const app = new Elysia()
|
|||||||
Effect.runPromise,
|
Effect.runPromise,
|
||||||
);
|
);
|
||||||
|
|
||||||
return redirect(url, 302);
|
redirect(url, 302);
|
||||||
}, {
|
}, {
|
||||||
response: {
|
response: {
|
||||||
302: t.Void(),
|
302: t.Void(),
|
||||||
@@ -229,7 +229,7 @@ const app = new Elysia()
|
|||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect(process.env.NODE_ENV === "production" ? "https://music.renati.me/" : "http://localhost:5173/", 303);
|
redirect(process.env.NODE_ENV === "production" ? "https://music.renati.me/" : "http://localhost:5173/", 303);
|
||||||
}, {
|
}, {
|
||||||
response: {
|
response: {
|
||||||
303: t.Void(),
|
303: t.Void(),
|
||||||
|
|||||||
@@ -222,22 +222,5 @@ export async function initDatabase(filename: string = "db.sqlite3"): Promise<Kys
|
|||||||
.columns(["pieceId", "filename"])
|
.columns(["pieceId", "filename"])
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
const { count } = await db
|
|
||||||
.selectFrom("User")
|
|
||||||
.select((eb) => eb.fn.countAll().as("count"))
|
|
||||||
.executeTakeFirstOrThrow();
|
|
||||||
|
|
||||||
if (BigInt(count) === 0n) {
|
|
||||||
const userId = UserId(Bun.randomUUIDv7());
|
|
||||||
const username = "admin";
|
|
||||||
const password = await Bun.password.hash("admin");
|
|
||||||
const admin = 1;
|
|
||||||
|
|
||||||
await db
|
|
||||||
.insertInto("User")
|
|
||||||
.values({ userId, username, password, admin })
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user