Merge branch 'be/lecture' into 'backend'

feat: lecture, quiz 이미지 미포함 등록 불가 수정

See merge request s11-webmobile1-sub2/S11P12A701!176
This commit is contained in:
김한얼 2024-08-12 15:28:26 +09:00
commit 1d307c006d
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ public class LectureController {
return new ResponseEntity<>(HttpStatus.CONFLICT); return new ResponseEntity<>(HttpStatus.CONFLICT);
} }
if (!image.isEmpty() && !image.getContentType().startsWith("image")) { if (image != null && !image.getContentType().startsWith("image")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST); return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
} }

View File

@ -39,7 +39,7 @@ public class QuizController {
} }
for (MultipartFile image : images) { for (MultipartFile image : images) {
if (!image.isEmpty() && !image.getContentType().startsWith("image")) { if (image != null && !image.getContentType().startsWith("image")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST); return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
} }
} }
@ -88,7 +88,7 @@ public class QuizController {
} }
for (MultipartFile image : images) { for (MultipartFile image : images) {
if (!image.isEmpty() && !image.getContentType().startsWith("image")) { if (image != null && !image.getContentType().startsWith("image")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST); return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
} }
} }