mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 10:35:17 +00:00
Merge remote-tracking branch 'origin' into feature-github-signin
This commit is contained in:
@@ -7,6 +7,7 @@ export {
|
||||
useGetOrganization,
|
||||
useGetOrgBillingDetails,
|
||||
useGetOrgInvoices,
|
||||
useGetOrgLicenses,
|
||||
useGetOrgPlanBillingInfo,
|
||||
useGetOrgPlansTable,
|
||||
useGetOrgPlanTable,
|
||||
@@ -14,5 +15,4 @@ export {
|
||||
useGetOrgTaxIds,
|
||||
useGetOrgTrialUrl,
|
||||
useRenameOrg,
|
||||
useUpdateOrgBillingDetails
|
||||
} from "./queries";
|
||||
useUpdateOrgBillingDetails} from "./queries";
|
||||
|
||||
@@ -5,14 +5,14 @@ import { apiRequest } from "@app/config/request";
|
||||
import {
|
||||
BillingDetails,
|
||||
Invoice,
|
||||
License,
|
||||
Organization,
|
||||
OrgPlanTable,
|
||||
PlanBillingInfo,
|
||||
PmtMethod,
|
||||
ProductsTable,
|
||||
RenameOrgDTO,
|
||||
TaxID
|
||||
} from "./types";
|
||||
TaxID} from "./types";
|
||||
|
||||
const organizationKeys = {
|
||||
getUserOrganization: ["organization"] as const,
|
||||
@@ -23,6 +23,7 @@ const organizationKeys = {
|
||||
getOrgPmtMethods: (orgId: string) => [{ orgId }, "organization-pmt-methods"] as const,
|
||||
getOrgTaxIds: (orgId: string) => [{ orgId }, "organization-tax-ids"] as const,
|
||||
getOrgInvoices: (orgId: string) => [{ orgId }, "organization-invoices"] as const,
|
||||
getOrgLicenses: (orgId: string) => [{ orgId }, "organization-licenses"] as const
|
||||
};
|
||||
|
||||
export const useGetOrganization = () => {
|
||||
@@ -311,4 +312,20 @@ export const useCreateCustomerPortalSession = () => {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export const useGetOrgLicenses = (organizationId: string) => {
|
||||
return useQuery({
|
||||
queryKey: organizationKeys.getOrgLicenses(organizationId),
|
||||
queryFn: async () => {
|
||||
if (organizationId === "") return undefined;
|
||||
|
||||
const { data } = await apiRequest.get<License[]>(
|
||||
`/api/v1/organizations/${organizationId}/licenses`
|
||||
);
|
||||
|
||||
return data;
|
||||
},
|
||||
enabled: true
|
||||
});
|
||||
}
|
||||
@@ -49,6 +49,17 @@ export type TaxID = {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export type License = {
|
||||
_id: string;
|
||||
customerId: string;
|
||||
prefix: string;
|
||||
licenseKey: string;
|
||||
isActivated: boolean;
|
||||
expiresAt: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type OrgPlanTableHead = {
|
||||
name: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user