mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-22 16:23:45 +02:00
api(application): relocate egg endpoints
This commit is contained in:
10
resources/scripts/api/admin/nests/getEggs.ts
Normal file
10
resources/scripts/api/admin/nests/getEggs.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user