diff --git a/app/controllers/api/v1/grid_summons_controller.rb b/app/controllers/api/v1/grid_summons_controller.rb index 2a40033..a34a035 100644 --- a/app/controllers/api/v1/grid_summons_controller.rb +++ b/app/controllers/api/v1/grid_summons_controller.rb @@ -3,7 +3,7 @@ module Api module V1 class GridSummonsController < Api::V1::ApiController - before_action :set, only: %w[destroy] + before_action :set, only: %w[update destroy] attr_reader :party, :incoming_summon @@ -24,6 +24,14 @@ module Api end end + def update + @summon.attributes = summon_params + + return render json: GridSummonBlueprint.render(@summon, view: :full) if @summon.save + + render_validation_error_response(@character) + end + def save_summon(summon) if (grid_summon = GridSummon.where( party_id: party.id, diff --git a/config/routes.rb b/config/routes.rb index e9a6b9f..70bdf6d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,7 @@ Rails.application.routes.draw do resources :users, only: %i[create update show] resources :grid_weapons, only: %i[update destroy] resources :grid_characters, only: %i[update destroy] - resources :grid_summons, only: %i[destroy] + resources :grid_summons, only: %i[update destroy] resources :favorites, only: [:create] get 'users/info/:id', to: 'users#info'