feat: add allowOther field to questions and update image upload to return data URIs
This commit is contained in:
@@ -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))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user