Unverified Commit 230d6232 authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #625 from mikemand/hotfix/issue-623

Only add the delete url if there is a user id is present
parents 1604c255 09085be1
......@@ -19,10 +19,13 @@ class FullRoleTransformer extends Resource
'created_at' => $this->created_at,
'permissions' => $permissions,
'users' => UserTransformer::collection($this->whenLoaded('users')),
'urls' => [
'delete_url' => route('api.user.role.destroy', $this->id),
],
'urls' => [],
];
if ($this->id) {
$data['urls'] = [
'delete_url' => route('api.user.role.destroy', $this->id),
];
}
return $data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment