dev add reason entity
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-03-27 16:37:20 +07:00
parent 547e70ecdd
commit 964910ec69
2 changed files with 3 additions and 9 deletions
@@ -60,6 +60,7 @@ public class ModerationService {
.moderationReasonId(request.getModerationReasonId())
.comment(request.getComment())
.build();
moderationLogRepository.save(log);
file.setStatus(request.getNewStatus());
@@ -91,7 +92,7 @@ public class ModerationService {
throw new SecurityException("User is not the owner of this file");
}
if (!canAppeal(file)) {
if (canAppeal(file)) {
throw new InvalidAppealException("Cannot appeal this file. Current status: " + file.getStatus());
}
@@ -156,11 +157,7 @@ public class ModerationService {
* Проверка, можно ли подать апелляцию на файл
*/
public boolean canAppeal(FileEntity file) {
if (file.getStatus() != FileStatus.BLOCKED) {
return false;
}
return true;
return file.getStatus() == FileStatus.BLOCKED;
}
/**