Add reactions to posts

This commit is contained in:
2024-03-31 09:03:40 +11:00
parent 185d363fbe
commit 03ba5ae54a
12 changed files with 85 additions and 4 deletions

View File

@@ -184,7 +184,7 @@ module Main
def fetch!(slug)
posts
.published
.combine(:tags, :trips, :webmentions)
.combine(:tags, :trips, :webmentions, :reactions)
.node(:webmentions) { |webmention|
webmention.published.where(type: "reply")
}

View File

@@ -0,0 +1,11 @@
module Main
module Repos
class ReactionRepo < Adamantium::Repo[:reactions]
commands :create
def count(post_id:)
reactions.where(post_id: post_id).count
end
end
end
end