Merge pull request 'UploadAPI and profilePicture' (#102) from tonitch/front/apiUpload into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test backend / Test-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 26s

Reviewed-on: #102
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
This commit is contained in:
2024-03-14 22:37:30 +01:00
5 changed files with 38 additions and 12 deletions

View File

@ -35,7 +35,7 @@ public class StorageService {
}
public String store(MultipartFile file, FileType fileType) {
public StorageFile store(MultipartFile file, FileType fileType) {
if (file.getOriginalFilename().isEmpty()){return null;}
@ -57,9 +57,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 {