2020-07-10 02:56:46 +00:00
|
|
|
import http from '@/api/http';
|
|
|
|
import { rawDataToServerAllocation } from '@/api/transformers';
|
|
|
|
import { Allocation } from '@/api/server/getServer';
|
|
|
|
|
|
|
|
export default async (uuid: string): Promise<Allocation[]> => {
|
2020-07-10 03:36:08 +00:00
|
|
|
const { data } = await http.get(`/api/client/servers/${uuid}/network/allocations`);
|
2020-07-10 02:56:46 +00:00
|
|
|
|
|
|
|
return (data.data || []).map(rawDataToServerAllocation);
|
|
|
|
};
|