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