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

story #11485 fix(pastis-standalone): fix profile uploading #1469

Merged
merged 1 commit into from
Sep 20, 2023
Merged
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 @@ -195,14 +195,14 @@ ResponseEntity<ProfileResponse> loadProfile(@RequestBody final Notice notice) th
consumes = "multipart/form-data",
produces = "application/json"
)
ResponseEntity<ProfileResponse> loadProfileFromFile(@RequestParam MultipartFile multipartFile) throws NoSuchAlgorithmException, TechnicalException {
final String originalFileName = multipartFile.getOriginalFilename();
ResponseEntity<ProfileResponse> loadProfileFromFile(@RequestParam MultipartFile file) throws NoSuchAlgorithmException, TechnicalException {
final String originalFileName = file.getOriginalFilename();

if (isInvalidFilename(originalFileName)) {
throw new ResponseStatusException(INTERNAL_SERVER_ERROR, ErrorMessage.INVALID_FILE_NAME.toString());
}

final ProfileResponse profileResponse = profileService.loadProfileFromFile(multipartFile, originalFileName, IS_STANDALONE);
final ProfileResponse profileResponse = profileService.loadProfileFromFile(file, originalFileName, IS_STANDALONE);

if (profileResponse == null) {
throw new ResponseStatusException(INTERNAL_SERVER_ERROR, ErrorMessage.NO_PROFILE_RESPONSE.toString());
Expand Down