Admin post management

This commit is contained in:
2023-05-07 17:28:45 +10:00
parent 4fb1b2b166
commit d679ea1947
8 changed files with 110 additions and 0 deletions

View File

@@ -32,6 +32,20 @@ module Admin
.published
.where(Sequel.ilike(:content, "%#{body_contains}%")).to_a
end
def list
posts
.where(post_type: "post")
.to_a
end
def delete(id:)
posts.where(id: id).delete
end
def archive(id:)
posts.where(id: id).update(published_at: nil)
end
end
end
end