Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/BE applicant can change profile picture #380

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@ public Member getMyDetails(Long id){
return service.getDetails(authenticatedUser.getId());

}

@PutMapping("/update/{newProfilePicture}")
public Member updateProfileAvatar(@PathVariable String newProfilePicture){
var applicant = CurrentUserUtil.getCurrentUser();
return service.updateAvatar(applicant.getId(), newProfilePicture);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public interface ApplicantService {
ApplyForMeResponse getApplicationList(int pageNo, int pageSize, String sortBy, String sortDir);
Member getDetails(Long id);

Member updateAvatar(Long applicantId, String newProfilePicture);

}
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,12 @@ public Member getDetails(Long id) {
return repository.getMyDetailsById(id);
}

@Override
public Member updateAvatar(Long applicantId, String newProfilePicture) {
Member applicant = repository.getMyDetailsById(applicantId);
applicant.setAvatar(newProfilePicture);

return applicant;
}

}