Update WeaponKey output for blueprinter

This commit is contained in:
Justin Edmund 2022-12-21 21:04:42 -08:00
parent 116ec9dbbc
commit 3b6edfae5d
2 changed files with 9 additions and 1 deletions

View file

@ -3,6 +3,14 @@
module Api module Api
module V1 module V1
class WeaponKeyBlueprint < ApiBlueprint class WeaponKeyBlueprint < ApiBlueprint
field :name do |key|
{
en: key.name_en,
ja: key.name_jp
}
end
fields :series, :slot, :group, :order
end end
end end
end end

View file

@ -10,7 +10,7 @@ module Api
conditions[:group] = request.params['group'] unless request.params['group'].blank? conditions[:group] = request.params['group'] unless request.params['group'].blank?
@keys = WeaponKey.where(conditions) @keys = WeaponKey.where(conditions)
render :all, status: :ok render json: WeaponKeyBlueprint.render(@keys)
end end
end end
end end