posts: rework post deletion to use dialog box.
Rework post deletion from using a separate page to using a dialog box, like flagging. * Add `DELETE /posts/:id` endpoint. * Remove `POST /moderator/post/posts/:id/delete` endpoint.
This commit is contained in:
@@ -31,6 +31,10 @@ class PostPolicy < ApplicationPolicy
|
||||
user.is_approver? && !record.is_deleted?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
delete?
|
||||
end
|
||||
|
||||
def ban?
|
||||
user.is_approver? && !record.is_banned?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user