Add study materials field to exam routes and update ExamModal for handling materials

This commit is contained in:
Space-Banane
2026-02-13 22:35:35 +01:00
parent 056519c0f1
commit d3cfca16f9
8 changed files with 124 additions and 14 deletions

View File

@@ -43,6 +43,7 @@ export = new fileRouter.Path("/").http(
date: new Date(exam.date),
result: "",
imageUrls: [],
studyMaterials: [],
userId: auth.userId,
createdAt: now,
updatedAt: now,

View File

@@ -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,

View File

@@ -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(),
})
);

View File

@@ -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;