hensei-api/app/blueprints/api/v1/raid_blueprint.rb
Justin Edmund 76f3b85613 Update raid blueprints
- Show flat representation of raid group in RaidBlueprint's nested view
- Show nested representation of raid in RaidGroupBlueprint's full view
2025-02-09 18:04:43 -08:00

25 lines
511 B
Ruby

# frozen_string_literal: true
module Api
module V1
class RaidBlueprint < ApiBlueprint
view :nested do
field :name do |raid|
{
en: raid.name_en,
ja: raid.name_jp
}
end
fields :slug, :level, :element
association :group, blueprint: RaidGroupBlueprint, view: :flat
end
view :full do
include_view :nested
association :group, blueprint: RaidGroupBlueprint, view: :flat
end
end
end
end