File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
course-matrix/backend/src/controllers Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ export default {
2525 . status ( 400 )
2626 . json ( { error : "timetable title and semester are required" } ) ;
2727 }
28+ // Timetables cannot be longer than 50 characters.
29+ if ( timetable_title . length > 50 ) {
30+ return res . status ( 400 ) . json ( { error : "Timetable Title cannot be over 50 characters long" } ) ;
31+ }
2832
2933 // Check if a timetable with the same title already exist for this user
3034 const { data : existingTimetable , error : existingTimetableError } =
@@ -169,6 +173,11 @@ export default {
169173 } ) ;
170174 }
171175
176+ // Timetables cannot be longer than 50 characters.
177+ if ( timetable_title . length > 50 ) {
178+ return res . status ( 400 ) . json ( { error : "Timetable Title cannot be over 50 characters long" } ) ;
179+ }
180+
172181 //Retrieve the authenticated user
173182 const user_id = ( req as any ) . user . id ;
174183
You can’t perform that action at this time.
0 commit comments