Skip to content

Commit

Permalink
add has_siblings_in_context to json api
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosteiner committed Sep 14, 2023
1 parent 1d048f4 commit 6f26130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/serializers/pbs/event_participation_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module Pbs::EventParticipationSerializer
translated_label: number.translated_label
}
end)

property :has_siblings_in_event, item.person.siblings_in_context(item.event).any?
end
end
end
4 changes: 4 additions & 0 deletions app/serializers/pbs/person_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ module Pbs::PersonSerializer
extension(:details) do |_|
map_properties :pbs_number, :salutation_value, :correspondence_language,
:prefers_digital_correspondence, :grade_of_school, :entry_date, :leaving_date


property :has_siblings_in_layer, item.siblings_in_context(context[:group]).any? if context[:group]
end

end

end

0 comments on commit 6f26130

Please sign in to comment.