diff --git a/src/main/java/com/islandcollaborative/creativeexchange/controllers/PostController.java b/src/main/java/com/islandcollaborative/creativeexchange/controllers/PostController.java index be4130d..fa35bc1 100644 --- a/src/main/java/com/islandcollaborative/creativeexchange/controllers/PostController.java +++ b/src/main/java/com/islandcollaborative/creativeexchange/controllers/PostController.java @@ -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"); } diff --git a/src/main/java/com/islandcollaborative/creativeexchange/services/AppUserService.java b/src/main/java/com/islandcollaborative/creativeexchange/services/AppUserService.java index 8eb32e6..a5853f8 100644 --- a/src/main/java/com/islandcollaborative/creativeexchange/services/AppUserService.java +++ b/src/main/java/com/islandcollaborative/creativeexchange/services/AppUserService.java @@ -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 { @@ -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() +