Remove the bad link between users and file. Add a delete function for storageFile entities and clean things.
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s

This commit is contained in:
2024-03-12 10:48:13 +01:00
parent ab91a39a63
commit 8fbfb36958
4 changed files with 8 additions and 39 deletions

View File

@ -30,7 +30,7 @@ public class StorageService {
}
public String store(MultipartFile file, FileType fileType, User user, InscriptionRequest request) {
public String store(MultipartFile file, FileType fileType) {
if (file.getOriginalFilename().isEmpty()){return null;}
@ -52,7 +52,7 @@ public class StorageService {
String url = this.rootLocation.resolve(Paths.get(Objects.requireNonNull(stringUuid)))
.normalize().toString();
fileRepo.save(new StorageFile(file.getName(),url, fileType, user, request));
fileRepo.save(new StorageFile(file.getName(),url, fileType));
return url;
}