mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 15:23:44 +02:00
api(application): relocate egg endpoints
This commit is contained in:
12
resources/scripts/api/admin/eggs/createEgg.ts
Normal file
12
resources/scripts/api/admin/eggs/createEgg.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import http from '@/api/http';
|
||||
import { Egg, rawDataToEgg } from '@/api/admin/eggs/getEgg';
|
||||
|
||||
export default (nestId: number, name: string): Promise<Egg> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post('/api/application/eggs', {
|
||||
nestId, name,
|
||||
})
|
||||
.then(({ data }) => resolve(rawDataToEgg(data.attributes)))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user