Commit 4971a9db authored by Deep Dey's avatar Deep Dey

chore: remove mother image mandatory

parent 772d8ed4
...@@ -49,12 +49,16 @@ public class AdmissionFormDAOController { ...@@ -49,12 +49,16 @@ public class AdmissionFormDAOController {
) )
); );
formData.setMotherImageName( if (formData.getMotherImage() != null) {
fileStorageService.storeFile( formData.setMotherImageName(
formData.getMotherImage(), fileStorageService.storeFile(
settings.getImageStoragePath() formData.getMotherImage(),
) settings.getImageStoragePath()
); )
);
} else {
formData.setMotherImageName("mother.png");
}
Long id = admissionFormDataRepository.saveAdmissionFormData(formData); Long id = admissionFormDataRepository.saveAdmissionFormData(formData);
formData.setId(id); formData.setId(id);
......
...@@ -91,7 +91,6 @@ public class AdmissionFormData { ...@@ -91,7 +91,6 @@ public class AdmissionFormData {
@NotNull(message = "Father Image cannot be empty") @NotNull(message = "Father Image cannot be empty")
private MultipartFile fatherImage; private MultipartFile fatherImage;
private String fatherImageName; private String fatherImageName;
@NotNull(message = "Mother Image cannot be empty")
private MultipartFile motherImage; private MultipartFile motherImage;
private String motherImageName; private String motherImageName;
private String interactionDate; private String interactionDate;
......
...@@ -27,6 +27,10 @@ public class WebMvcConfig implements WebMvcConfigurer { ...@@ -27,6 +27,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
.addResourceHandler("/resources/**") .addResourceHandler("/resources/**")
.addResourceLocations("file:" + settings.getStaticResourcesRootPath() + "/"); .addResourceLocations("file:" + settings.getStaticResourcesRootPath() + "/");
registry
.addResourceHandler("/resources/images/**")
.addResourceLocations("classpath:/static/images/");
registry.addResourceHandler("/static/**"). registry.addResourceHandler("/static/**").
addResourceLocations("classpath:/static/"); addResourceLocations("classpath:/static/");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment