feat: add allowOther field to questions and update image upload to return data URIs

This commit is contained in:
2026-05-30 01:35:33 +07:00 Unverified
parent 114804749c
commit 6a36965e8b
10 changed files with 689 additions and 27 deletions
+4
View File
@@ -37,6 +37,7 @@ export async function createQuestion(
required: data.required,
displayOrder: data.displayOrder,
options: data.options ?? [],
allowOther: false,
});
revalidatePath("/form");
revalidatePath("/form/admin");
@@ -52,6 +53,7 @@ export async function updateQuestion(
displayOrder: number;
options: string[];
imageUrl: string | null;
allowOther: boolean;
}>
) {
await assertAdmin();
@@ -77,6 +79,7 @@ export async function bulkUpdateQuestions(
required: boolean;
displayOrder: number;
options: string[];
allowOther: boolean;
}[]
) {
await assertAdmin();
@@ -92,6 +95,7 @@ export async function bulkUpdateQuestions(
required: u.required,
displayOrder: u.displayOrder,
options: u.options ?? [],
allowOther: u.allowOther,
})
.where(eq(questions.id, u.id))
)