dev fix show image
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-01-29 13:08:43 +07:00
parent ec20d68261
commit ff7836900b
@@ -43,8 +43,8 @@ public class FileController {
FileEntity fileEntity = fileRepository.findById(fileId)
.orElseThrow(() -> new RuntimeException("File not found"));
if (fileEntity.getProtectionStatus() != ProtectionStatus.NOT_PROTECTED) {
throw new RuntimeException("File is protected");
if (fileEntity.getProtectionStatus() == ProtectionStatus.NOT_PROTECTED) {
throw new RuntimeException("File is not protected");
}
Resource resource = fileStorageService.loadFileAsResource(fileEntity.getProtectedFilePath());