Attachment form and table, MusicXML renderer

This commit is contained in:
2024-11-24 13:37:26 +01:00
parent a347a77e11
commit 02b4c08e7d
12 changed files with 1603 additions and 61 deletions

View File

@@ -68,7 +68,7 @@ const app = new Elysia()
console.log(`${timestamp} ${method} ${request.url} ${ip}`);
})
// --- AUTHENTICATION ------------------------------------------------------
// --- MARK: AUTHENTICATION ------------------------------------------------
.get("/me", async ({ user }) => {
@@ -145,7 +145,7 @@ const app = new Elysia()
.execute();
})
// --- PIECE CRUD ----------------------------------------------------------
// --- MARK: PIECE CRUD ----------------------------------------------------
.post("/piece", async ({ db, body: { name, composer, lyricist, arranger }, user }) => {
@@ -248,7 +248,7 @@ const app = new Elysia()
}),
})
// --- ATTACHMENT CRUD -----------------------------------------------------
// --- MARK: ATTACHMENT CRUD -----------------------------------------------
.post("piece/:pieceId/attachment", async ({ db, body: { filename, mediaType, data }, params: { pieceId }, user }) => {
@@ -264,8 +264,8 @@ const app = new Elysia()
await db
.insertInto("File")
.ignore()
.values({ sha256, data: dataArray })
.onConflict((cb) => cb.column("sha256").doNothing())
.execute();
const res = await db