This commit is contained in:
2026-05-26 05:52:09 +09:00
parent dc54f9cbb5
commit 638dccad6d
18 changed files with 259 additions and 55 deletions
+2 -2
View File
@@ -42,12 +42,12 @@ class UsersController < ApplicationController
return head :unauthorized if user&.id != params[:id].to_i
name = params[:name]
return head :bad_request if name.blank?
return render_bad_request('名前は必須です.', field: :name) if name.blank?
if user.update(name:)
render json: user.slice(:id, :name, :inheritance_code, :role), status: :ok
else
render json: user.errors, status: :unprocessable_entity
render_model_errors(user)
end
end