api(application): relocate egg endpoints
This commit is contained in:
parent
5946210e18
commit
58cfa98b9c
23 changed files with 309 additions and 112 deletions
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);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue