Hello.
I am trying to implement a custom users view using this code example. However, the ability to filter my custom users view by roles does not seem to work anymore. The URL does get updated on click, but no filtering is happening. Anyone know what I am missing?
Kirby::plugin('custom/users-view', [
'areas' => [
'users' => function () {
return [
'label' => 'Accounts',
'icon' => 'users',
'menu' => true,
'link' => 'users',
'views' => [
'users' => [
'pattern' => 'users',
'action' => function () {
$users = [];
$usersCollection = kirby()->users()->sortBy('lastname', 'asc');
foreach ($usersCollection as $user) {
$users[] = [
'id' => $user->id(),
'image' => false,
'link' => '\/users/' . $user->id(),
'text' => strtoupper($user->lastname()->value()) . ' ' . $user->firstname()->value(),
'info' => $user->email()
];
}
return [
'component' => 'k-users-view',
'props' => [
'role' => [
'id' => 'admin',
'title' => 'Admin'
],
'roles' => [
['id' => 'admin', 'title' => 'Admin'],
['id' => 'editor', 'title' => 'Editor'],
['id' => 'customer', 'title' => 'Kund:in'],
],
'users' => [
'data' => $users,
'pagination' => [
'page' => 1,
'total' => 100,
'limit' => 20
]
]
]
];
}
]
]
];
}
]
]);
```