api(application): relocate egg endpoints

This commit is contained in:
Matthew Penner 2021-01-08 09:25:40 -07:00
parent 5946210e18
commit 58cfa98b9c
23 changed files with 309 additions and 112 deletions

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