admin(ui): use new node port columns

This commit is contained in:
Matthew Penner 2021-02-11 10:21:49 -07:00
parent 5f56ff0fed
commit 3c2094890a
7 changed files with 160 additions and 28 deletions

View file

@ -1,10 +1,10 @@
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> => {
export default (id: number, node: Partial<Node>, include: string[] = []): Promise<Node> => {
return new Promise((resolve, reject) => {
http.patch(`/api/application/nodes/${id}`, {
name, description,
...node,
}, { params: { include: include.join(',') } })
.then(({ data }) => resolve(rawDataToNode(data)))
.catch(reject);