cannot destroy custom role which still has users
DELETE /api/v1/custom_roles/:id
Parameters
| Name |
Description |
|
id
|
id
|
|
name
|
role's name
|
Request
Headers
Route
DELETE /api/v1/custom_roles/21
Body
{}
cURL
curl "http://localhost:3000/api/v1/custom_roles/21" -d '{}' -X DELETE \
-H "Accept: application/json" \
-H "X-Api-Token: tcyxEMHnLb558zb3vxt7g5TEgwMSa91qzg" \
-H "X-Api-Email: user-323@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
422 Unprocessable Entity
Body
{
"errors": {
"base": [
"Cannot be destroyed while it is assigned to users."
]
}
}