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:
Jeppe Bundgaard
2026-02-12 13:35:47 +01:00
parent 62a7f8d259
commit 0fddaa79a7
@@ -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) ?: [],