mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 13:53:45 +02:00
Logic fixes
This commit is contained in:
@@ -4,12 +4,12 @@ import http from '@/api/http';
|
||||
import { rawDataToServerAllocation } from '@/api/transformers';
|
||||
import { Allocation } from '@/api/server/getServer';
|
||||
|
||||
export default (initialData?: Allocation[]) => {
|
||||
export default () => {
|
||||
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
||||
|
||||
return useSWR<Allocation[]>([ 'server:allocations', uuid ], async () => {
|
||||
const { data } = await http.get(`/api/client/servers/${uuid}/network/allocations`);
|
||||
|
||||
return (data.data || []).map(rawDataToServerAllocation);
|
||||
}, { initialData, revalidateOnFocus: false });
|
||||
}, { revalidateOnFocus: false, revalidateOnMount: false });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user