mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-12 03:13:45 +02:00
api(application): fix 'PATCH' nest endpoint
This commit is contained in:
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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user