File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
+ BadRequestException ,
2
3
ConflictException ,
3
4
Inject ,
4
5
Injectable ,
@@ -50,6 +51,14 @@ export class ScheduleService {
50
51
throw new NotFoundException ( 'Timetable not found' ) ;
51
52
}
52
53
54
+ if (
55
+ createScheduleRequestDto . startTime >= createScheduleRequestDto . endTime
56
+ ) {
57
+ throw new BadRequestException (
58
+ 'Start time must be earlier than end time' ,
59
+ ) ;
60
+ }
61
+
53
62
// 시간표에 존재하는 강의, 스케쥴과 추가하려는 스케쥴이 시간이 겹치는 지 확인
54
63
const isConflict = await this . checkTimeConflict ( createScheduleRequestDto ) ;
55
64
@@ -102,6 +111,13 @@ export class ScheduleService {
102
111
updateScheduleRequestDto . startTime &&
103
112
updateScheduleRequestDto . endTime
104
113
) {
114
+ if (
115
+ updateScheduleRequestDto . startTime >= updateScheduleRequestDto . endTime
116
+ ) {
117
+ throw new BadRequestException (
118
+ 'Start time must be earlier than end time' ,
119
+ ) ;
120
+ }
105
121
// 시간표에 존재하는 강의, 스케쥴과 수정하려는 스케쥴이 시간이 겹치는 지 확인
106
122
const isConflict = await this . checkTimeConflict (
107
123
updateScheduleRequestDto ,
You can’t perform that action at this time.
0 commit comments