Skip to content

Commit

Permalink
DEV: Use ReactionSerializer` for reactions (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancernik authored Jun 26, 2024
1 parent 7dc7294 commit 673d2cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/serializers/reaction_serializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true
class ReactionSerializer < ApplicationSerializer
attributes :id, :post_id, :reaction_type, :reaction_value, :reaction_users_count, :created_at
end
2 changes: 1 addition & 1 deletion app/serializers/user_reaction_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ class UserReactionSerializer < ApplicationSerializer

has_one :user, serializer: GroupPostUserSerializer, embed: :object
has_one :post, serializer: GroupPostSerializer, embed: :object
has_one :reaction, embed: :object
has_one :reaction, serializer: ReactionSerializer, embed: :object
end
1 change: 1 addition & 0 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Engine < ::Rails::Engine
app/controllers/discourse_reactions/custom_reactions_controller.rb
app/models/discourse_reactions/reaction_user.rb
app/models/discourse_reactions/reaction.rb
app/serializers/reaction_serializer.rb
app/serializers/user_reaction_serializer.rb
app/services/discourse_reactions/reaction_manager.rb
app/services/discourse_reactions/reaction_notification.rb
Expand Down

0 comments on commit 673d2cd

Please sign in to comment.