Add name field to /subusers/grants response for improved subuser data clarity
- Retrieve and include the `name` field from the `subusers_o` object in the grant response.
This commit is contained in:
@@ -66,10 +66,12 @@ class subusersRoute
|
||||
}
|
||||
$paginatedResponse = (new subuser_grants_o())->listObjectsWithPaginationIfSet(function ($o) {
|
||||
$o = (object)$o;
|
||||
$subuser = (new subusers_o())->select((int)$o->subuser);
|
||||
return [
|
||||
'id' => $o->id,
|
||||
'billing_customer_number' => $o->billing_customer_number,
|
||||
'subuser' => $o->subuser,
|
||||
'name' => $subuser->name->value(),
|
||||
'enabled' => $o->enabled,
|
||||
'note' => $o->note,
|
||||
'permissions' => json_decode($o->permissions, true) ?: [],
|
||||
|
||||
Reference in New Issue
Block a user