import http from '@/api/http'; import { Transformers, Allocation } from '@definitions/user'; const createServerAllocation = async (uuid: string): Promise => { const { data } = await http.post(`/api/client/servers/${uuid}/network/allocations`); return Transformers.toServerAllocation(data); }; const deleteServerAllocation = async (uuid: string, id: number): Promise => await http.delete(`/api/client/servers/${uuid}/network/allocations/${id}`); const setPrimaryServerAllocation = async (uuid: string, id: number): Promise => { const { data } = await http.post(`/api/client/servers/${uuid}/network/allocations/${id}/primary`); return Transformers.toServerAllocation(data); }; const setServerAllocationNotes = async (uuid: string, id: number, notes: string | null): Promise => { const { data } = await http.post(`/api/client/servers/${uuid}/network/allocations/${id}`, { notes }); return Transformers.toServerAllocation(data); }; export { createServerAllocation, deleteServerAllocation, setPrimaryServerAllocation, setServerAllocationNotes, };