Modifying backend so it send the full entry of a file upload

This commit is contained in:
2024-03-13 22:28:59 +01:00
parent 68e55e8355
commit a0285e700d
7 changed files with 23 additions and 10 deletions

View File

@ -27,7 +27,7 @@ public class StorageService {
}
public String store(MultipartFile file, FileType fileType) {
public StorageFile store(MultipartFile file, FileType fileType) {
if (file.getOriginalFilename().isEmpty()){return null;}
@ -49,9 +49,7 @@ public class StorageService {
String url = this.rootLocation.resolve(Paths.get(Objects.requireNonNull(stringUuid)))
.normalize().toString();
fileRepo.save(new StorageFile(file.getName(),url, fileType));
return url;
return fileRepo.save(new StorageFile(file.getName(),url, fileType));
}
public void delete(StorageFile file) throws SecurityException {