Fix tsc errors
This commit is contained in:
@@ -179,7 +179,7 @@ const app = new Elysia()
|
||||
Effect.runPromise,
|
||||
);
|
||||
|
||||
return redirect(url, 302);
|
||||
redirect(url, 302);
|
||||
}, {
|
||||
response: {
|
||||
302: t.Void(),
|
||||
@@ -229,7 +229,7 @@ const app = new Elysia()
|
||||
.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: {
|
||||
303: t.Void(),
|
||||
|
||||
@@ -222,22 +222,5 @@ export async function initDatabase(filename: string = "db.sqlite3"): Promise<Kys
|
||||
.columns(["pieceId", "filename"])
|
||||
.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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user