mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-16 21:33:44 +02:00
ui(admin): start work on node settings
This commit is contained in:
12
resources/scripts/api/admin/nodes/updateNode.ts
Normal file
12
resources/scripts/api/admin/nodes/updateNode.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import http from '@/api/http';
|
||||
import { Node, rawDataToNode } from '@/api/admin/nodes/getNodes';
|
||||
|
||||
export default (id: number, name: string, description: string | null, include: string[] = []): Promise<Node> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.patch(`/api/application/nodes/${id}`, {
|
||||
name, description,
|
||||
}, { params: { include: include.join(',') } })
|
||||
.then(({ data }) => resolve(rawDataToNode(data)))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user