feat(subscription): Refactor subscription handling and update imports for better organization

This commit is contained in:
web@ppanel
2025-03-08 12:34:23 +07:00
parent 3222016799
commit 2215c7f2b9
27 changed files with 1042 additions and 180 deletions
+6 -2
View File
@@ -4,7 +4,8 @@ import { Display } from '@/components/display';
import { SubscribeBilling } from '@/components/subscribe/billing';
import { SubscribeDetail } from '@/components/subscribe/detail';
import useGlobalStore from '@/config/use-global';
import { checkoutOrder, queryOrderDetail } from '@/services/user/order';
import { queryOrderDetail } from '@/services/user/order';
import { purchaseCheckout } from '@/services/user/portal';
import { useQuery } from '@tanstack/react-query';
import { Badge } from '@workspace/ui/components/badge';
import { Button } from '@workspace/ui/components/button';
@@ -50,7 +51,10 @@ export default function Page() {
enabled: !!orderNo && data?.status === 1,
queryKey: ['checkoutOrder', orderNo],
queryFn: async () => {
const { data } = await checkoutOrder({ orderNo: orderNo!, returnUrl: window.location.href });
const { data } = await purchaseCheckout({
orderNo: orderNo!,
returnUrl: window.location.href,
});
return data?.data;
},
});