From 070449d5167e986530c036c5fc14eb119db4ccb2 Mon Sep 17 00:00:00 2001 From: Leonardo Petrora Date: Mon, 16 Dec 2024 16:28:39 +0100 Subject: [PATCH] quick_setup: rename save action endpoint and types Depends on https://review.lan.tribe29.com/c/check_mk/+/91453 CMK-20707 Change-Id: Ied0e8aa59899336a2f1767ebbd180f272df29510 --- packages/cmk-frontend-vue/src/quick-setup/rest-api/api.ts | 6 +++--- .../cmk-frontend-vue/src/quick-setup/rest-api/constants.ts | 2 +- .../src/quick-setup/rest-api/request_types.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 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 379a2769ca5..2d155c63a91 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 @@ -24,7 +24,7 @@ import type { QuickSetupOverviewResponse, QuickSetupStageStructure } from './response_types' -import type { QuickSetupFinalSaveRequest, QuickSetupStageActionRequest } from './request_types' +import type { QuickSetupFinalActionRequest, QuickSetupStageActionRequest } from './request_types' import { wait } from '@/lib/utils' /** * Wait until background job is finished @@ -97,7 +97,7 @@ export const saveQuickSetup = async ( formData: StageData[] ): Promise => { const url = SAVE_QUICK_SETUP_URL.replace('{QUICK_SETUP_ID}', quickSetupId) - const payload: QuickSetupFinalSaveRequest = { + const payload: QuickSetupFinalActionRequest = { button_id: buttonId, stages: formData.map((step) => ({ form_data: step })) } @@ -128,7 +128,7 @@ export const editQuickSetup = async ( '{QUICK_SETUP_ID}', quickSetupId ) - const payload: QuickSetupFinalSaveRequest = { + const payload: QuickSetupFinalActionRequest = { button_id: buttonId, stages: formData.map((step) => ({ form_data: step })) } diff --git a/packages/cmk-frontend-vue/src/quick-setup/rest-api/constants.ts b/packages/cmk-frontend-vue/src/quick-setup/rest-api/constants.ts index 53af89c7283..e24b0e09148 100644 --- a/packages/cmk-frontend-vue/src/quick-setup/rest-api/constants.ts +++ b/packages/cmk-frontend-vue/src/quick-setup/rest-api/constants.ts @@ -18,7 +18,7 @@ export const FETCH_QUICK_SETUP_STAGE_STRUCTURE_URL = `${API_ROOT}/objects/quick_ export const VALIDATE_AND_RECAP_STAGE_URL = `${API_ROOT}/objects/quick_setup/{QUICK_SETUP_ID}/actions/run-stage-action/invoke` /** @constant {string} SAVE_QUICK_SETUP_URL - Save the quick setup */ -export const SAVE_QUICK_SETUP_URL = `${API_ROOT}/objects/quick_setup/{QUICK_SETUP_ID}/actions/save/invoke` +export const SAVE_QUICK_SETUP_URL = `${API_ROOT}/objects/quick_setup/{QUICK_SETUP_ID}/actions/run-action/invoke` /** @constant {string} EDIT_QUICK_SETUP_URL - Edit the quick setup */ export const EDIT_QUICK_SETUP_URL = `${API_ROOT}/objects/quick_setup/{QUICK_SETUP_ID}/actions/edit/invoke` diff --git a/packages/cmk-frontend-vue/src/quick-setup/rest-api/request_types.ts b/packages/cmk-frontend-vue/src/quick-setup/rest-api/request_types.ts index 721b5eb3170..615295949c2 100644 --- a/packages/cmk-frontend-vue/src/quick-setup/rest-api/request_types.ts +++ b/packages/cmk-frontend-vue/src/quick-setup/rest-api/request_types.ts @@ -20,9 +20,9 @@ export interface QuickSetupStageActionRequest { } /** - * Save the quick setup + * Execute action on final stage */ -export interface QuickSetupFinalSaveRequest { +export interface QuickSetupFinalActionRequest { button_id: string stages: QuickSetupStageRequest[] }