diff --git a/ui/package-lock.json b/ui/package-lock.json index 15bad63a4f..4a50ea5530 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -829,9 +829,9 @@ "dev": true }, "@influxdata/influx": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@influxdata/influx/-/influx-0.1.9.tgz", - "integrity": "sha512-AoOK71N/jUqAJxGVFZ2quPe79eeDvtZuzF0ITzg4HXeVDZJrdWL2c1HeF/gbS1OOQcMj4UGFMXUzzeSpRaXY4g==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/@influxdata/influx/-/influx-0.1.10.tgz", + "integrity": "sha512-KGVxR2tYzRSrfCJItHhR5e+1a6iuqq6Ted7PphgThm/v/zkqwRmc4EveoudjDFgcqyh34aRw1AY73jkXj7tJ1A==", "requires": { "axios": "^0.18.0" } diff --git a/ui/package.json b/ui/package.json index e9adc46416..3f52f6d3bc 100644 --- a/ui/package.json +++ b/ui/package.json @@ -117,7 +117,7 @@ }, "dependencies": { "@influxdata/react-custom-scrollbars": "4.3.8", - "@influxdata/influx": "^0.1.9", + "@influxdata/influx": "^0.1.10", "axios": "^0.18.0", "babel-polyfill": "^6.26.0", "bignumber.js": "^4.0.2", diff --git a/ui/src/dashboards/apis/v2/index.ts b/ui/src/dashboards/apis/v2/index.ts index 1f9e4f8d82..9e846579d0 100644 --- a/ui/src/dashboards/apis/v2/index.ts +++ b/ui/src/dashboards/apis/v2/index.ts @@ -1,5 +1,5 @@ // Libraries -import {dashboardsAPI, cellsAPI} from 'src/utils/api' +import {dashboardsAPI} from 'src/utils/api' import _ from 'lodash' // Utils @@ -18,6 +18,7 @@ import { } from 'src/types/v2' import {Cell as CellTypeAPI} from 'src/api' +import {client} from 'src/utils/api' // Utils import { @@ -101,12 +102,9 @@ export const addCell = async ( dashboardID: string, cell: NewCell ): Promise => { - const {data} = await cellsAPI.dashboardsDashboardIDCellsPost( - dashboardID, - cell - ) + const result = await client.dashboards.createCell(dashboardID, cell) - const cellWithID = {...data, dashboardID} + const cellWithID = {...result, dashboardID} return cellWithID } @@ -115,16 +113,16 @@ export const updateCells = async ( id: string, cells: Cell[] ): Promise => { - const {data} = await cellsAPI.dashboardsDashboardIDCellsPut(id, cells) + const result = await client.dashboards.updateAllCells(id, cells) - return addDashboardIDToCells(data.cells, id) + return addDashboardIDToCells(result, id) } export const deleteCell = async ( dashboardID: string, cell: Cell ): Promise => { - await cellsAPI.dashboardsDashboardIDCellsCellIDDelete(dashboardID, cell.id) + await client.dashboards.deleteCell(dashboardID, cell.id) } export const addDashboardLabels = async ( diff --git a/ui/src/utils/api.ts b/ui/src/utils/api.ts index e7a2614ca0..73dc2a66fa 100644 --- a/ui/src/utils/api.ts +++ b/ui/src/utils/api.ts @@ -1,4 +1,4 @@ -import {DashboardsApi, CellsApi, ViewsApi, QueryApi, ProtosApi} from 'src/api' +import {DashboardsApi, QueryApi, ProtosApi} from 'src/api' import Client from '@influxdata/influx' @@ -6,8 +6,6 @@ const basePath = '/api/v2' export const client = new Client(basePath) -export const viewsAPI = new ViewsApi({basePath}) export const dashboardsAPI = new DashboardsApi({basePath}) -export const cellsAPI = new CellsApi({basePath}) export const queryAPI = new QueryApi({basePath}) export const protosAPI = new ProtosApi({basePath})