Add bookmark admin

This commit is contained in:
2023-05-07 11:31:15 +10:00
parent fa146fbfb3
commit 3fddc1757e
17 changed files with 186 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
module Admin
module Repos
class BookmarkRepo < Adamantium::Repo[:posts]
def list
posts
.where(post_type: "bookmark")
.to_a
end
def fetch(id:)
posts.where(id: id).one
end
def delete(id:)
posts.where(id: id).delete
end
def update(id:, cached_content:)
posts.where(id: id).update(cached_content: cached_content)
end
end
end
end

View File

@@ -5,6 +5,10 @@ module Admin
def delete(tag_id:)
post_tags.where(tag_id: tag_id).delete
end
def delete_by_post_id(post_id:)
post_tags.where(post_id: post_id).delete
end
end
end
end