Remove the bad link between users and file. Add a delete function for storageFile entities and clean things.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user