Skip to content

Commit

Permalink
Merge pull request #526 from mozzy11/fix_role
Browse files Browse the repository at this point in the history
fix Updating image and image display
  • Loading branch information
mozzy11 authored Aug 25, 2023
2 parents 72353c4 + 72a03eb commit 0fdc36f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public void saveImage(Image image, boolean newImage, String imageId, SiteInforma
if (!newImage) {
// The reason the old image is deleted and a new one added is because updating
// the image doesn't work.
image.setId(imageId);
imageService.delete(image);
}
imageService.save(image);
Image savedImage = imageService.save(image);

logoInformation.setValue(image.getId());
logoInformation.setValue(savedImage.getId());
logoInformation.setSysUserId("1");
siteInformationService.update(logoInformation);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/pages/siteinformation/siteInformation.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</c:if>
<c:if test="${form.valueType == 'logoUpload'}">
<input type="hidden" name="logoName" id="logoName" />
<img id="imagePreview" src="./dbImage/siteInformation/${form.paramName}.jpg"
<img id="imagePreview" src="./dbImage/siteInformation/${form.paramName}"
height="42"
width="42" />
<br>
Expand Down

0 comments on commit 0fdc36f

Please sign in to comment.