ui(admin): start work on node settings

This commit is contained in:
Matthew Penner 2021-01-30 13:53:47 -07:00
parent 2a0c99163b
commit be1b05e0ec
4 changed files with 128 additions and 6 deletions

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