misc_pterodactyl-panel/resources/scripts/api/admin/nests/getEggs.ts
2021-01-08 09:26:57 -07:00

10 lines
367 B
TypeScript

import http from '@/api/http';
import { Egg, rawDataToEgg } from '@/api/admin/eggs/getEgg';
export default (nestId: number): Promise<Egg[]> => {
return new Promise((resolve, reject) => {
http.get(`/api/application/nests/${nestId}/eggs`)
.then(({ data }) => resolve((data.data || []).map(rawDataToEgg)))
.catch(reject);
});
};