Stage 10 final
This commit is contained in:
@@ -16,6 +16,12 @@ create_report(ReporterId, TargetType, TargetId, Reason) ->
|
||||
true ->
|
||||
case core_report:create(ReporterId, TargetType, TargetId, Reason) of
|
||||
{ok, Report} ->
|
||||
logic_notification:notify_admin(report_created, #{
|
||||
report_id => Report#report.id,
|
||||
target_type => TargetType,
|
||||
target_id => TargetId,
|
||||
reason => Reason
|
||||
}),
|
||||
% Проверяем порог для авто-модерации
|
||||
check_auto_freeze(TargetType, TargetId),
|
||||
{ok, Report};
|
||||
@@ -116,7 +122,7 @@ freeze_calendar(AdminId, CalendarId) ->
|
||||
case is_admin(AdminId) of
|
||||
true ->
|
||||
case core_calendar:get_by_id(CalendarId) of
|
||||
{ok, Calendar} ->
|
||||
{ok, _Calendar} ->
|
||||
core_calendar:update(CalendarId, [{status, frozen}]);
|
||||
Error -> Error
|
||||
end;
|
||||
@@ -128,7 +134,7 @@ unfreeze_calendar(AdminId, CalendarId) ->
|
||||
case is_admin(AdminId) of
|
||||
true ->
|
||||
case core_calendar:get_by_id(CalendarId) of
|
||||
{ok, Calendar} ->
|
||||
{ok, _Calendar} ->
|
||||
core_calendar:update(CalendarId, [{status, active}]);
|
||||
Error -> Error
|
||||
end;
|
||||
@@ -140,7 +146,7 @@ freeze_event(AdminId, EventId) ->
|
||||
case is_admin(AdminId) of
|
||||
true ->
|
||||
case core_event:get_by_id(EventId) of
|
||||
{ok, Event} ->
|
||||
{ok, _Event} ->
|
||||
core_event:update(EventId, [{status, frozen}]);
|
||||
Error -> Error
|
||||
end;
|
||||
@@ -152,7 +158,7 @@ unfreeze_event(AdminId, EventId) ->
|
||||
case is_admin(AdminId) of
|
||||
true ->
|
||||
case core_event:get_by_id(EventId) of
|
||||
{ok, Event} ->
|
||||
{ok, _Event} ->
|
||||
core_event:update(EventId, [{status, active}]);
|
||||
Error -> Error
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user