mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
Revert "refactor(console): replace get sku api" (#6868)
Revert "refactor(console): replace get sku api (#6861)"
This reverts commit 51c9c52a61
.
This commit is contained in:
parent
8a15a60c37
commit
ba84b1aed8
1 changed files with 3 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
import { type Optional } from '@silverhand/essentials';
|
||||
import { useContext, useMemo } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import useSWRImmutable from 'swr/immutable';
|
||||
|
||||
import { useCloudApi } from '@/cloud/hooks/use-cloud-api';
|
||||
|
@ -9,7 +9,6 @@ import { featuredPlanIdOrder } from '@/consts/subscriptions';
|
|||
// Used in the docs
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import TenantAccess from '@/containers/TenantAccess';
|
||||
import { TenantsContext } from '@/contexts/TenantsProvider';
|
||||
import { LogtoSkuType } from '@/types/skus';
|
||||
import { sortBy } from '@/utils/sort';
|
||||
import { addSupportQuota } from '@/utils/subscription';
|
||||
|
@ -20,13 +19,11 @@ import { addSupportQuota } from '@/utils/subscription';
|
|||
*/
|
||||
const useLogtoSkus = () => {
|
||||
const cloudApi = useCloudApi();
|
||||
const { currentTenantId } = useContext(TenantsContext);
|
||||
|
||||
const useSwrResponse = useSWRImmutable<LogtoSkuResponse[], Error>(
|
||||
isCloud && currentTenantId && `/api/tenants/${currentTenantId}/available-skus`,
|
||||
isCloud && '/api/skus',
|
||||
async () =>
|
||||
cloudApi.get('/api/tenants/:tenantId/available-skus', {
|
||||
params: { tenantId: currentTenantId },
|
||||
cloudApi.get('/api/skus', {
|
||||
search: { type: LogtoSkuType.Basic },
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue