diff --git a/src/components/home/HomeCom.jsx b/src/components/home/HomeCom.jsx
index 8beceb4..09247ac 100644
--- a/src/components/home/HomeCom.jsx
+++ b/src/components/home/HomeCom.jsx
@@ -155,7 +155,9 @@ export default function HomeCom() {
-
+
diff --git a/src/components/subscription_view/SubscriptionViewCom.jsx b/src/components/subscription_view/SubscriptionViewCom.jsx
index e1d7c0c..8db7abd 100644
--- a/src/components/subscription_view/SubscriptionViewCom.jsx
+++ b/src/components/subscription_view/SubscriptionViewCom.jsx
@@ -1,47 +1,96 @@
import {useLocation, useNavigate, Link} from 'react-router-dom'
+import { useQuery } from '@tanstack/react-query'
+import { FaCaretDown } from "react-icons/fa";
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
import {useEffect} from 'react';
+import RouteLinks from '../../RouteLinks';
+import { getSubscriptionsView } from '../../services/siteServices'
+import queryKeys from '../../services/queryKeys'
export default function SubscriptionViewCom() {
- const subscriptionUID = "63554d40-9ba1-4afe-80c2-ca147236f7ee";
- const {state: {memberUID}} = useLocation()
+ const {state} = useLocation()
const navigate = useNavigate()
useEffect(() => {
- if (!memberUID) {
- navigate(`/account-view/${memberUID}`, {replace: true, state: {memberUID}})
+ if (!state?.subscriptionUID) {
+ navigate(RouteLinks.homePage, {replace: true})
}
}, [])
+ const {data, isFetching, isError, error} = useQuery({
+ queryKey: queryKeys.subscriptions_view,
+ queryFn: () => {
+ // const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
+ const reqData = {
+ subscription_uid: state?.subscriptionUID
+ // page,
+ // ...filterData
+ }
+ return getSubscriptionsView(reqData)
+ },
+ staleTime: 0 //0 mins
+ })
+ const subscriptionViewData = data?.data // ACCOUNT VIEW DATA
+ console.log('subscriptionViewData', subscriptionViewData)
+
return (
-
+
-
+ {isFetching ?
+ <>
+
Loading...
+ >
+ : isError ?
+
{error.message}
+ :
+ <>
+
-
- Repeat the Subscription at the top
+
+ Repeat the Subscription at the top
-
-
+
+
-
+
-
-
Assign Template
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
Assign Custom Template
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ }
-
-
)
diff --git a/src/components/transactions/SubscriptionsCom.jsx b/src/components/transactions/SubscriptionsCom.jsx
index 271461c..aacb4fa 100644
--- a/src/components/transactions/SubscriptionsCom.jsx
+++ b/src/components/transactions/SubscriptionsCom.jsx
@@ -146,7 +146,7 @@ export default function SubscriptionsCom() {
diff --git a/src/services/queryKeys.js b/src/services/queryKeys.js
index 887a02f..77f2a05 100644
--- a/src/services/queryKeys.js
+++ b/src/services/queryKeys.js
@@ -20,6 +20,7 @@ const queryKeys = {
products_template: ['products_template'],
custom_template: ['custom_template'],
account_view: ['account_view'],
+ subscriptions_view: ['subscriptions_view'],
users_admin: ['users_admin'],
}
diff --git a/src/services/siteServices.js b/src/services/siteServices.js
index 3ab7350..11c4bc8 100644
--- a/src/services/siteServices.js
+++ b/src/services/siteServices.js
@@ -116,6 +116,12 @@ export const getAccountView = (reqData) => {
return getAuxEnd(`/account-view`, postData)
}
+// FUNCTION TO GET SUBSCRIPTIONS VIEW DATA
+export const getSubscriptionsView = (reqData) => {
+ const postData = { ...reqData }
+ return getAuxEnd(`/subcription-view`, postData)
+}
+
// FUNCTION TO GET LOANS TABLE
export const getLoans = (reqData) => {