Skip to content

Commit

Permalink
⚙️ :: (#483) save
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsoftj1123 committed Mar 4, 2024
1 parent 3664358 commit 5e075fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CompanyFilter {
private final Integer year;
private final Long page;
@Builder.Default
private int limit = 11;
private int limit = 10;

public Long getOffset() {
return page * limit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import team.retum.jobis.domain.student.dto.UpdateForgottenPasswordRequest;
import team.retum.jobis.domain.user.exception.UserNotFoundException;
import team.retum.jobis.domain.user.model.User;
import team.retum.jobis.domain.user.spi.CommandUserPort;
import team.retum.jobis.domain.user.spi.QueryUserPort;

@RequiredArgsConstructor
Expand All @@ -17,6 +18,7 @@ public class UpdateStudentForgottenPasswordUseCase {
private final QueryUserPort queryUserPort;
private final QueryAuthCodePort queryAuthCodePort;
private final SecurityPort securityPort;
private final CommandUserPort commandUserPort;

public void execute(UpdateForgottenPasswordRequest request) {
if (!queryUserPort.existsUserByAccountId(request.getEmail())) {
Expand All @@ -29,6 +31,8 @@ public void execute(UpdateForgottenPasswordRequest request) {
User userEntity = queryUserPort.queryUserByAccountId(request.getEmail())
.orElseThrow(() -> UserNotFoundException.EXCEPTION);

userEntity.updatePassword(securityPort.encodePassword(request.getPassword()));
commandUserPort.saveUser(
userEntity.updatePassword(securityPort.encodePassword(request.getPassword()))
);
}
}

0 comments on commit 5e075fd

Please sign in to comment.