mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 15:41:27 +00:00
lots of frontend improvements
This commit is contained in:
@@ -2,20 +2,20 @@ import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { apiRequest } from '@app/config/request';
|
||||
|
||||
import { GetSubscriptionPlan } from './types';
|
||||
import { SubscriptionPlan } from './types';
|
||||
|
||||
// import { Workspace } from './types';
|
||||
|
||||
const subscriptionKeys = {
|
||||
getOrgSubsription: (orgID: string) => ['subscription', { orgID }] as const
|
||||
getOrgSubsription: (orgID: string) => ['plan', { orgID }] as const
|
||||
};
|
||||
|
||||
const fetchOrgSubscription = async (orgID: string) => {
|
||||
const { data } = await apiRequest.get<{ subscriptions: GetSubscriptionPlan }>(
|
||||
`/api/v1/organization/${orgID}/subscriptions`
|
||||
const { data } = await apiRequest.get<{ plan: SubscriptionPlan }>(
|
||||
`/api/v1/organizations/${orgID}/plan`
|
||||
);
|
||||
|
||||
return data.subscriptions;
|
||||
return data.plan;
|
||||
};
|
||||
|
||||
type UseGetOrgSubscriptionProps = {
|
||||
|
||||
@@ -1,25 +1,16 @@
|
||||
export type GetSubscriptionPlan = {
|
||||
data: { plan: SubscriptionPlan }[];
|
||||
};
|
||||
|
||||
export type SubscriptionPlan = {
|
||||
id: string;
|
||||
object: string;
|
||||
active: boolean;
|
||||
aggregate_usage: unknown;
|
||||
amount: 1400;
|
||||
amount_decimal: 1400;
|
||||
billing_scheme: string;
|
||||
created: 1674833546;
|
||||
currency: string;
|
||||
interval: string;
|
||||
interval_count: 1;
|
||||
livemode: false;
|
||||
metadata: {};
|
||||
nickname: null;
|
||||
product: string;
|
||||
tiers_mode: unknown;
|
||||
transform_usage: unknown;
|
||||
trial_period_days: unknown;
|
||||
usage_type: string;
|
||||
_id: string;
|
||||
membersUsed: number;
|
||||
membersLimit: number;
|
||||
auditLogs: boolean;
|
||||
customAlerts: boolean;
|
||||
customRateLimits: boolean;
|
||||
pitRecovery: boolean;
|
||||
rbac: boolean;
|
||||
secretVersioning: boolean;
|
||||
slug: string;
|
||||
tier: number;
|
||||
workspaceLimit: number;
|
||||
workspacesUsed: number;
|
||||
envLimit: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user