More details on posts and error reporting

This commit is contained in:
2023-05-31 22:12:48 +10:00
parent b034ecb3ab
commit 2c1122c9d7
20 changed files with 177 additions and 39 deletions

View File

@@ -4,6 +4,7 @@ module Admin
def list
posts
.where(post_type: "bookmark")
.order(Sequel.lit("published_at desc"))
.to_a
end

View File

@@ -38,6 +38,7 @@ module Admin
def list
posts
.where(post_type: "post")
.order(Sequel.lit("published_at desc"))
.to_a
end
@@ -45,6 +46,10 @@ module Admin
posts.where(id: id).delete
end
def publish(id:)
posts.where(id: id).update(published_at: Time.now)
end
def archive(id:)
posts.where(id: id).update(published_at: nil)
end