Add update method to GridSummonsController

This commit is contained in:
Justin Edmund 2023-01-22 20:37:52 -08:00
parent bb79f68a2c
commit 8c1fae02d4
2 changed files with 10 additions and 2 deletions

View file

@ -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,

View file

@ -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'