Skip to content
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 @@ -102,8 +102,8 @@ public RedirectView addPost(HttpServletRequest request, String text, String titl
@PutMapping("/posts/{postId}")
public RedirectView updatePosts(@PathVariable long postId, String text, String title) {
Post post = postRepository.getOne(postId);
post.setText(text);
post.setTitle(title);
if (text != null && !text.isBlank()) post.setText(text);
if (title != null && !title.isBlank()) post.setTitle(title);
postRepository.save(post);
return new RedirectView("/posts/" + postId + "/edit");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public void updateProfilePicture(AppUser userPrincipal,
if (ext == null) throw new InvalidContentTypeException("File type must be a jpg or png");

String path = profileImageRoot + userPrincipal.getId() + ext;
System.out.println("=============DEBUG============");
System.out.println(path);
System.out.println("=============DEBUG============");
InputStream stream = new BufferedInputStream(image.getInputStream());

try {
Expand All @@ -56,9 +53,6 @@ public void updateProfilePicture(AppUser userPrincipal,
}

public String getProfilePicturePath(AppUser userPrincipal) {
System.out.println("=============DEBUG============");
System.out.println(profileImageRoot + userPrincipal.getId() + userPrincipal.getImageExtension());
System.out.println("=============DEBUG============");
return userPrincipal.hasProfilePicture() ?
fileUploadService.getURL(
profileImageRoot + userPrincipal.getId() +
Expand Down