From 0a61382f50e5cf01f0a399cec09c7b334b3ebf8b Mon Sep 17 00:00:00 2001 From: Leonardo Petrora Date: Thu, 12 Dec 2024 09:49:31 +0100 Subject: [PATCH] Quick setup: Fix edit notifications Change-Id: Ia7ed66a7b3bdd7d9b98a51b22885058795f88023 --- .../src/quick-setup/rest-api/api.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/cmk-frontend-vue/src/quick-setup/rest-api/api.ts b/packages/cmk-frontend-vue/src/quick-setup/rest-api/api.ts index 0a86dedc377..3edaa81f8fb 100644 --- a/packages/cmk-frontend-vue/src/quick-setup/rest-api/api.ts +++ b/packages/cmk-frontend-vue/src/quick-setup/rest-api/api.ts @@ -105,7 +105,12 @@ export const saveQuickSetup = async ( stages: formData.map((step) => ({ form_data: step })) } - return await _saveQuickSetup(url, payload) + try { + const { data } = await axios.post(url, payload) + return data + } catch (err) { + throw processError(err) + } } /** @@ -131,15 +136,8 @@ export const editQuickSetup = async ( stages: formData.map((step) => ({ form_data: step })) } - return await _saveQuickSetup(url, payload) -} - -const _saveQuickSetup = async ( - url: string, - payload: QSRequestComplete -): Promise => { try { - const { data } = await axios.post(url, payload) + const { data } = await axios.put(url, payload) return data } catch (err) { throw processError(err)