mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
ServersContainer: cleanup api code
This commit is contained in:
@@ -49,11 +49,11 @@ interface ctx {
|
||||
|
||||
export const Context = createContext<ctx>({ page: 1, setPage: () => 1 });
|
||||
|
||||
export default () => {
|
||||
export default (include: string[] = []) => {
|
||||
const { page } = useContext(Context);
|
||||
|
||||
return useSWR<PaginatedResult<Server>>([ 'servers', page ], async () => {
|
||||
const { data } = await http.get('/api/application/servers', { params: { include: 'node,user', page } });
|
||||
const { data } = await http.get('/api/application/servers', { params: { include: include.join(','), page } });
|
||||
|
||||
return ({
|
||||
items: (data.data || []).map(rawDataToServerObject),
|
||||
|
||||
Reference in New Issue
Block a user