Skip to content

Commit

Permalink
FIX: user 관심 category 수정 기능 에러 픽스
Browse files Browse the repository at this point in the history
<footer>
- 해결: #176
  • Loading branch information
luke0408 committed Feb 26, 2024
1 parent 67c5762 commit 93ea12a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ private void checkUploadProfileImageRequestValidation(MultipartFile image) {
}

public void updateUserCategory(Users user, MypageRequest.UpdateCategoryRequest request) {
user.setUsersCategory(request.getCategories());
userService.updateUserCategory(user, request.getCategories());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.example.betteriter.fo_domain.user.repository.UsersRepository;
import com.example.betteriter.fo_domain.user.repository.UsersWithdrawReasonRepository;
import com.example.betteriter.global.common.code.status.ErrorStatus;
import com.example.betteriter.global.constant.Category;
import com.example.betteriter.global.util.RedisUtil;
import com.example.betteriter.global.util.SecurityUtil;
import com.example.betteriter.infra.s3.S3Service;
Expand All @@ -17,9 +18,9 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -104,4 +105,9 @@ public Users getUserByEmail(String email) {
public void updateUserDetail(UsersDetail detail) {
this.userDetailRepository.save(detail);
}

public void updateUserCategory(Users user, List<Category> categories) {
user.setUsersCategory(categories);
this.usersRepository.save(user);
}
}

0 comments on commit 93ea12a

Please sign in to comment.