misc_pterodactyl-panel/resources/scripts/api/admin/nests/createNest.ts

13 lines
405 B
TypeScript
Raw Normal View History

2021-01-01 00:27:16 +00:00
import http from '@/api/http';
2021-01-06 23:38:39 +00:00
import { Nest, rawDataToNest } from '@/api/admin/nests/getNests';
2021-01-01 00:27:16 +00:00
export default (name: string, description?: string): Promise<Nest> => {
return new Promise((resolve, reject) => {
http.post('/api/application/nests', {
name, description,
})
2021-01-06 23:38:39 +00:00
.then(({ data }) => resolve(rawDataToNest(data)))
2021-01-01 00:27:16 +00:00
.catch(reject);
});
};