mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-16 13:23:45 +02:00
Only request servers as an admin if actually an admin; closes #3242
This commit is contained in:
@@ -25,8 +25,8 @@ export default () => {
|
||||
const [ showOnlyAdmin, setShowOnlyAdmin ] = usePersistedState(`${uuid}:show_all_servers`, false);
|
||||
|
||||
const { data: servers, error } = useSWR<PaginatedResult<Server>>(
|
||||
[ '/api/client/servers', showOnlyAdmin, page ],
|
||||
() => getServers({ page, type: showOnlyAdmin ? 'admin' : undefined }),
|
||||
[ '/api/client/servers', (showOnlyAdmin && rootAdmin), page ],
|
||||
() => getServers({ page, type: (showOnlyAdmin && rootAdmin) ? 'admin' : undefined }),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user