File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
backend/src/main/java/io/f1/backend/domain/quiz/app Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -159,17 +159,16 @@ private void validateImageFile(MultipartFile thumbnailFile) {
159159
160160 @ Transactional
161161 public void deleteQuiz (Long quizId ) {
162- Quiz quiz = findQuiz (quizId );
162+ Quiz quiz = findQuizWithQuestions (quizId );
163163
164164 verifyUserAuthority (quiz );
165165
166166 deleteImageFile (quiz .getThumbnailUrl ());
167- if (quiz .getQuizType ().equals (QuizType .IMAGE )) {
168- for (Question question : quiz .getQuestions ()) {
169- String imagePath = question .getContentQuestion ().getContent ();
170- deleteImageFile (imagePath );
171- }
167+
168+ for (Question question : quiz .getQuestions ()) {
169+ questionService .deleteQuestion (question .getId (), quiz .getQuizType ());
172170 }
171+
173172 quizRepository .deleteById (quizId );
174173 }
175174
You can’t perform that action at this time.
0 commit comments