From 7bbc68bfd527647a63f1951cbce2c9f64193bbb0 Mon Sep 17 00:00:00 2001 From: pycook Date: Thu, 24 Oct 2019 11:23:48 +0800 Subject: [PATCH] fix delete ci type --- ui/src/api/cmdb/CIType.js | 14 +++++++++++++- ui/src/api/cmdb/CITypeAttr.js | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ui/src/api/cmdb/CIType.js b/ui/src/api/cmdb/CIType.js index 7ec6137..ebf826e 100644 --- a/ui/src/api/cmdb/CIType.js +++ b/ui/src/api/cmdb/CIType.js @@ -54,10 +54,22 @@ export function updateCIType (CITypeId, data) { }) } +/** + * 删除 ci_type + * @param CITypeId + * @returns {AxiosPromise} + */ +export function deleteCIType (CITypeId) { + return axios({ + url: `/v0.1/ci_types/${CITypeId}`, + method: 'DELETE' + }) +} + /** * 获取 某个 ci_type 的分组 * @param CITypeId - * @param parameter + * @param data * @returns {AxiosPromise} */ export function getCITypeGroupById (CITypeId, data) { diff --git a/ui/src/api/cmdb/CITypeAttr.js b/ui/src/api/cmdb/CITypeAttr.js index dcce000..f1dd0b1 100644 --- a/ui/src/api/cmdb/CITypeAttr.js +++ b/ui/src/api/cmdb/CITypeAttr.js @@ -61,11 +61,11 @@ export function createAttribute (data) { * @param data * @returns {AxiosPromise} */ -export function searchAttributes (data) { +export function searchAttributes (params) { return axios({ url: `/v0.1/attributes/s`, method: 'get', - params: data + params: params }) }