Skip to content

Commit

Permalink
Quick setup: Fix edit notifications
Browse files Browse the repository at this point in the history
Change-Id: Ia7ed66a7b3bdd7d9b98a51b22885058795f88023
  • Loading branch information
lpetrora committed Dec 12, 2024
1 parent 701027c commit 0a61382
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/cmk-frontend-vue/src/quick-setup/rest-api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

/**
Expand All @@ -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<QSResponseComplete> => {
try {
const { data } = await axios.post(url, payload)
const { data } = await axios.put(url, payload)
return data
} catch (err) {
throw processError(err)
Expand Down

0 comments on commit 0a61382

Please sign in to comment.