From 76aca62dd35027450f5e9272db856a3eac07f0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 5 Jul 2023 12:57:50 +0200 Subject: [PATCH] refactor: Switch cloud plan retrieval endpoint (no-changelog) (#6529) * refactor: Switch cloud plan retrieval endpoint * refactor: Remove user ID from request * refactor: Update endpoint * refactor: Update to /rest/admin/cloud-plan * refactor: Remove redundant `/rest` segment --- packages/editor-ui/src/api/cloudPlans.ts | 7 ++----- packages/editor-ui/src/stores/cloudPlan.store.ts | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/editor-ui/src/api/cloudPlans.ts b/packages/editor-ui/src/api/cloudPlans.ts index 27dc6cc7ed..e0d15299dc 100644 --- a/packages/editor-ui/src/api/cloudPlans.ts +++ b/packages/editor-ui/src/api/cloudPlans.ts @@ -1,11 +1,8 @@ import type { Cloud, IRestApiContext, InstanceUsage } from '@/Interface'; import { get } from '@/utils'; -export async function getCurrentPlan( - context: IRestApiContext, - cloudUserId: string, -): Promise { - return get(context.baseUrl, `/user/${cloudUserId}/plan`); +export async function getCurrentPlan(context: IRestApiContext): Promise { + return get(context.baseUrl, '/admin/cloud-plan'); } export async function getCurrentUsage(context: IRestApiContext): Promise { diff --git a/packages/editor-ui/src/stores/cloudPlan.store.ts b/packages/editor-ui/src/stores/cloudPlan.store.ts index 6bf6465d9c..38194ee15a 100644 --- a/packages/editor-ui/src/stores/cloudPlan.store.ts +++ b/packages/editor-ui/src/stores/cloudPlan.store.ts @@ -53,7 +53,7 @@ export const useCloudPlanStore = defineStore('cloudPlan', () => { state.loadingPlan = true; let plan; try { - plan = await getCurrentPlan(rootStore.getRestCloudApiContext, `${cloudUserId}`); + plan = await getCurrentPlan(rootStore.getRestApiContext); state.data = plan; state.loadingPlan = false; } catch (error) {