api(application): fix 'PATCH' nest endpoint

This commit is contained in:
Matthew Penner 2021-01-08 09:44:05 -07:00
parent 58cfa98b9c
commit 0e366f69ee
3 changed files with 20 additions and 8 deletions

View file

@ -0,0 +1,12 @@
import http from '@/api/http';
import { Nest, rawDataToNest } from '@/api/admin/nests/getNests';
export default (id: number, name: string, description?: string): Promise<Nest> => {
return new Promise((resolve, reject) => {
http.patch(`/api/application/nests/${id}`, {
name, description,
})
.then(({ data }) => resolve(rawDataToNest(data)))
.catch(reject);
});
};