Add admin area

This commit is contained in:
2023-05-06 17:11:54 +10:00
parent 08943a3f93
commit c4bd903e74
21 changed files with 258 additions and 5 deletions

View File

@@ -0,0 +1,11 @@
module Admin
module Repos
class PostTagRepo < Adamantium::Repo[:post_tags]
def delete(tag_id:)
post_tags.where(tag_id: tag_id).delete
end
end
end
end

View File

@@ -0,0 +1,16 @@
module Admin
module Repos
class TagRepo < Adamantium::Repo[:tags]
def list
tags
.combine(:posts)
.order(Sequel.function(:lower, :label))
.to_a
end
def delete(tag_id:)
tags.by_pk(tag_id).delete
end
end
end
end