Skip to content

Commit

Permalink
accept call put role without name
Browse files Browse the repository at this point in the history
  • Loading branch information
Mh-Asmi committed Feb 13, 2024
1 parent 74bbb72 commit d51274a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ushahidi/Modules/V5/Http/Controllers/RoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public function update(RoleRequest $request, int $id)
$role = $this->queryBus->handle(new FetchRoleByIdQuery($id));
$this->authorize('update', $role);

if ($role->name !== $request->input('name')) {

if ($request->has('name') && $role->name !== $request->input('name')) {
return self::make422("Role name cannot be updated.");
}

Expand Down

0 comments on commit d51274a

Please sign in to comment.