Fix admin UUID parsing error on test upload
This commit is contained in:
@@ -187,7 +187,7 @@ export default function AdminTestsPage() {
|
||||
formData.append("title", title)
|
||||
formData.append("exam_pattern", examPattern)
|
||||
formData.append("time_limit", timeLimit)
|
||||
formData.append("admin_id", userId as string)
|
||||
formData.append("admin_id", userId === "admin" ? "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" : (userId as string))
|
||||
if (scheduledDate) formData.append("scheduled_date", scheduledDate.toISOString())
|
||||
|
||||
const res = await fetchWithAuth("/api/admin/tests/upload", {
|
||||
@@ -224,7 +224,7 @@ export default function AdminTestsPage() {
|
||||
type: testType,
|
||||
exam_pattern: examPattern,
|
||||
time_limit: parseInt(timeLimit),
|
||||
admin_id: userId,
|
||||
admin_id: userId === "admin" ? "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" : userId,
|
||||
questions_json: validQuestions,
|
||||
scheduled_date: scheduledDate ? scheduledDate.toISOString() : null,
|
||||
end_date: endDate ? endDate.toISOString() : null,
|
||||
@@ -491,3 +491,4 @@ export default function AdminTestsPage() {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user