Add study materials field to exam routes and update ExamModal for handling materials
This commit is contained in:
@@ -43,6 +43,7 @@ export = new fileRouter.Path("/").http(
|
||||
date: new Date(exam.date),
|
||||
result: "",
|
||||
imageUrls: [],
|
||||
studyMaterials: [],
|
||||
userId: auth.userId,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
|
||||
@@ -28,6 +28,7 @@ export = new fileRouter.Path("/").http(
|
||||
}),
|
||||
result: z.string().min(1).max(100).optional(),
|
||||
imageUrls: z.array(z.string().url()).optional(),
|
||||
studyMaterials: z.array(z.string().url()).optional(),
|
||||
})
|
||||
);
|
||||
|
||||
@@ -46,6 +47,7 @@ export = new fileRouter.Path("/").http(
|
||||
date: new Date(data.date),
|
||||
result: data.result || "",
|
||||
imageUrls: data.imageUrls || [],
|
||||
studyMaterials: data.studyMaterials || [],
|
||||
userId: auth.userId,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
|
||||
@@ -25,6 +25,7 @@ export = new fileRouter.Path("/").http(
|
||||
date: z.string().refine((val) => !isNaN(Date.parse(val))).optional(),
|
||||
result: z.string().min(1).max(100).optional(),
|
||||
imageUrls: z.array(z.string().url()).optional(),
|
||||
studyMaterials: z.array(z.string().url()).optional(),
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ interface Exam {
|
||||
|
||||
description?: string; // Optional field for additional details about the exam
|
||||
imageUrls?: string[]; // Optional array of image URLs related to the exam (e.g. scanned results, certificates)
|
||||
studyMaterials?: string[]; // Optional array of study materials URLs
|
||||
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
|
||||
Reference in New Issue
Block a user