mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
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
This commit is contained in:
parent
7ffe3cb36a
commit
76aca62dd3
|
@ -1,11 +1,8 @@
|
|||
import type { Cloud, IRestApiContext, InstanceUsage } from '@/Interface';
|
||||
import { get } from '@/utils';
|
||||
|
||||
export async function getCurrentPlan(
|
||||
context: IRestApiContext,
|
||||
cloudUserId: string,
|
||||
): Promise<Cloud.PlanData> {
|
||||
return get(context.baseUrl, `/user/${cloudUserId}/plan`);
|
||||
export async function getCurrentPlan(context: IRestApiContext): Promise<Cloud.PlanData> {
|
||||
return get(context.baseUrl, '/admin/cloud-plan');
|
||||
}
|
||||
|
||||
export async function getCurrentUsage(context: IRestApiContext): Promise<InstanceUsage> {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue