[FIX] 会員登録の際、コースを直接設定するようにしました。
This commit is contained in:
@@ -5,7 +5,7 @@ import com.example.demo.app.presentation.form.UserForm;
|
||||
|
||||
public interface UserService {
|
||||
|
||||
void register(UserForm userForm);
|
||||
void register(UserForm userForm, Long courseId);
|
||||
|
||||
public void updateCourse(Long userId, Long courseId);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class UserServiceImpl implements UserService {
|
||||
private final CourseRepository courseRepository;
|
||||
|
||||
@Override
|
||||
public void register(UserForm userForm) {
|
||||
public void register(UserForm userForm, Long courseId) {
|
||||
|
||||
UserEntity userEntity = new UserEntity();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class UserServiceImpl implements UserService {
|
||||
goalRepository.findById(userForm.getGoalId()).orElse(null);
|
||||
|
||||
CourseEntity courseEntity =
|
||||
courseRepository.findById(userForm.getCourseId()).orElse(null);
|
||||
courseRepository.findById(courseId).orElse(null);
|
||||
|
||||
userEntity.setQuestionEntity(questionEntity);
|
||||
userEntity.setGoalEntity(goalEntity);
|
||||
|
||||
Reference in New Issue
Block a user