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

11 lines
367 B
TypeScript
Raw Normal View History

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);
});
};