Skip to content

Commit

Permalink
fix: 퀴즈 수정 어드민 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Feb 7, 2024
1 parent de98ec6 commit de50659
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,17 @@ public AdminQuizResponse update(AuthUser authUser, Long quizId, AdminQuizSaveOrU
if (!categoryRepository.existsById(request.getCategoryId())) {
throw new ApplicationErrorException(ApplicationErrorType.NOT_FOUND_CATEGORY_ERROR);
}

var updatedQuestion = quizRepository.save(
Quiz.builder()
.title(request.getTitle())
.tags(request.getTags())
.categoryId(request.getCategoryId())
.question(request.getQuestion())
.quizType(request.getQuizType())
.description(request.getDescription())
.answer(request.getAnswer())
.deleted(false)
.createdBy(authUser.getId())
.build()
quiz.update(
request.getTitle(),
request.getTags(),
request.getCategoryId(),
request.getQuestion(),
request.getQuizType(),
request.getDescription(),
request.getAnswer()
)
);

quizCacheService.setCachedQuiz(updatedQuestion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,18 @@ public Quiz update(
String title,
List<String> tags,
String categoryId,
Map<String, Object> question,
QuizType quizType,
Map<String, Object> question
String description,
String answer
) {
this.title = title;
this.tags = tags;
this.categoryId = categoryId;
this.quizType = quizType;
this.question = question;
this.quizType = quizType;
this.description = description;
this.answer = answer;

return this;
}
Expand Down

0 comments on commit de50659

Please # to comment.