From 4d7c98c52167fdaf265dafb329fc8f168bb01cfd Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Wed, 9 Sep 2026 17:33:11 +0800 Subject: [PATCH] fixed mobile responsiveness, unit is not optional when posting --- src/lib/server/api.ts | 4 ++-- src/routes/admin/+page.svelte | 16 +++++++++++++--- src/routes/post/note/+page.svelte | 6 +++--- src/routes/post/question/+page.svelte | 6 +++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/lib/server/api.ts b/src/lib/server/api.ts index 423b7f7..baede5c 100644 --- a/src/lib/server/api.ts +++ b/src/lib/server/api.ts @@ -488,7 +488,7 @@ function notesCreate( const user = requireAuth(db, args.token); const topicId = args.topicId?.trim() ?? ""; const unitId = args.unitId?.trim() ?? ""; - if (!topicId && !unitId) throw new Error("Select a topic or a unit"); + if (!unitId) throw new Error("Select a unit"); const id = newId(); const now = Date.now(); db.exec("BEGIN"); @@ -597,7 +597,7 @@ function questionsCreate( const user = requireAuth(db, args.token); const topicId = args.topicId?.trim() ?? ""; const unitId = args.unitId?.trim() ?? ""; - if (!topicId && !unitId) throw new Error("Select a topic or a unit"); + if (!unitId) throw new Error("Select a unit"); const id = newId(); const now = Date.now(); db.exec("BEGIN"); diff --git a/src/routes/admin/+page.svelte b/src/routes/admin/+page.svelte index 236546d..7a3945d 100644 --- a/src/routes/admin/+page.svelte +++ b/src/routes/admin/+page.svelte @@ -471,14 +471,18 @@ {/if} {:else} -
Admin