@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user