Update WeaponKey output for blueprinter
This commit is contained in:
parent
116ec9dbbc
commit
3b6edfae5d
2 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue