- Create IdResolvable concern for flexible ID lookups - Update character/summon/weapon controllers to use concern - Support both UUID and granblue_id in API calls
22 lines
410 B
Ruby
22 lines
410 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class WeaponsController < Api::V1::ApiController
|
|
include IdResolvable
|
|
|
|
before_action :set
|
|
|
|
def show
|
|
render json: WeaponBlueprint.render(@weapon)
|
|
end
|
|
|
|
private
|
|
|
|
def set
|
|
@weapon = find_by_any_id(Weapon, params[:id])
|
|
render_not_found_response('weapon') unless @weapon
|
|
end
|
|
end
|
|
end
|
|
end
|