Merge branch 'RED-7086-fixes' into 'master'
RED-7086 - Enable async file deletion and fix response code Closes RED-7086 See merge request redactmanager/persistence-service!349
This commit is contained in:
commit
f3bd2b0120
@ -205,8 +205,12 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
accessControlService.checkDossierExistenceAndAccessPermissionsToDossier(dossierId);
|
||||
fileIds.forEach(fileId -> {
|
||||
if (fileStatusManagementService.getFileStatus(fileId).getAssignee() != null) {
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
try {
|
||||
if (fileStatusManagementService.getFileStatus(fileId).getAssignee() != null) {
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
}
|
||||
} catch (NotFoundException e) {
|
||||
log.warn("File {} to be deleted was not found.", fileId);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ public interface FileManagementResource {
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = HARD_DELETE_PATH + DOSSIER_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Hard deletes a list of files", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully hard deleted the files."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "202", description = "Successfully hard deleted the files."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
void hardDeleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> files);
|
||||
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.ConflictException;
|
||||
@ -160,6 +161,7 @@ public class FileService {
|
||||
}
|
||||
|
||||
|
||||
@Async
|
||||
public void hardDeleteFiles(String dossierId, List<String> fileIds) {
|
||||
|
||||
var dossier = dossierService.getDossierById(dossierId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user