misc_pterodactyl-panel/resources/scripts/api/server/network/newServerAllocation.ts
Caleb 8f8bd0be83 Added Automatic Allocations
Known issues:
- Port range to auto create is hard coded
- React interface is still a WIP.
2020-09-28 11:50:34 -04:00

11 lines
436 B
TypeScript

import { Allocation } from '@/api/server/getServer';
import http from '@/api/http';
import { rawDataToServerAllocation } from '@/api/transformers';
export default (uuid: string): Promise<Allocation> => {
return new Promise((resolve, reject) => {
http.get(`/api/client/servers/${uuid}/network/allocations/new`)
.then(({ data }) => resolve(rawDataToServerAllocation(data)))
.catch(reject);
});
};