1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-15 12:29:16 +01:00

(bug) fix unable to update/delete a space

This commit is contained in:
Du Peng 2022-12-12 14:19:57 +01:00
parent 1db7dfc723
commit 766c08a302

View File

@ -27,7 +27,7 @@ class API::SpacesController < API::ApiController
end
def update
authorize Space
authorize @space
if @space.update(space_params)
render :show, status: :ok, location: @space
else
@ -45,7 +45,7 @@ class API::SpacesController < API::ApiController
private
def set_space
Space.friendly.find(params[:id])
@space = Space.friendly.find(params[:id])
end
def space_params