api(application): fix 'PATCH' nest endpoint
This commit is contained in:
parent
58cfa98b9c
commit
0e366f69ee
3 changed files with 20 additions and 8 deletions
12
resources/scripts/api/admin/nests/updateNest.ts
Normal file
12
resources/scripts/api/admin/nests/updateNest.ts
Normal 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);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue