From ebcde80a3dd6d18406080ce11b99196b93fc1b88 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Sun, 28 Sep 2025 14:31:22 +0100 Subject: [PATCH] account view subscription table data fixed --- .../account_view/AccountViewCom.jsx | 15 +- .../account_view/CustomerAccountView.jsx | 114 ++++++++----- .../account_view/CustomerPaymentsView.jsx | 103 +++++++----- .../CustomerSubscriptionsView.jsx | 156 +++++++++--------- .../subscription_view/SubscriptionViewCom.jsx | 15 +- 5 files changed, 242 insertions(+), 161 deletions(-) diff --git a/src/components/account_view/AccountViewCom.jsx b/src/components/account_view/AccountViewCom.jsx index 6012790..3523fee 100644 --- a/src/components/account_view/AccountViewCom.jsx +++ b/src/components/account_view/AccountViewCom.jsx @@ -36,9 +36,12 @@ export default function AccountViewCom() { }, staleTime: 0 //0 mins }) - const accountsViewData = data?.data?.products // ACCOUNT VIEW DATA - const pagination = data?.data?.pagination - console.log('DATA', data?.data) + const accountsViewData = data?.data // ACCOUNT VIEW DATA + const account_info = accountsViewData?.account + const account_profile = accountsViewData?.account_profile + const subscriptions = accountsViewData?.subscriptions + const payments = accountsViewData?.payments + // console.log('DATA', payments, subscriptions) return (
@@ -53,10 +56,10 @@ export default function AccountViewCom() {

{error.message}

: <> - + - - + + } diff --git a/src/components/account_view/CustomerAccountView.jsx b/src/components/account_view/CustomerAccountView.jsx index e7fdb5b..8c971ad 100644 --- a/src/components/account_view/CustomerAccountView.jsx +++ b/src/components/account_view/CustomerAccountView.jsx @@ -1,51 +1,91 @@ +import {Link} from 'react-router-dom' import Icons from "../Icons"; -export default function CustomerAccountView() { +export default function CustomerAccountView({accountInfo}) { return <> -
-
-
-
-
-

Account Info

-
-
-
-
- - - - - - - - - - - - - - - - - - +
+
+
+

Account Info

+
+
+ <> +
idFirstnameLastnameUsernameEmailAction
1MarkOtto@mdoOtto
+ + + + + + + + + + + + {(accountInfo && Object.keys(accountInfo).length > 0) ? + + + + + + - - -
+ # + + Firstname + + Lastname + + Username + + Email + + Action +
+
+
{1}
+
+
+
+
{accountInfo?.firstname}
+
+
+
+
{accountInfo?.lastname}
+
+
+
+
{accountInfo?.username}
+
+
+
+
{accountInfo?.email}
+
+
- {/**/} - - {/**/} + + +
-
-
+ : + + +
+ No Record Found +
+ + + } + + +
diff --git a/src/components/account_view/CustomerPaymentsView.jsx b/src/components/account_view/CustomerPaymentsView.jsx index 7d39ea9..47084a2 100644 --- a/src/components/account_view/CustomerPaymentsView.jsx +++ b/src/components/account_view/CustomerPaymentsView.jsx @@ -1,48 +1,67 @@ -export default function CustomerPaymentsView() { +export default function CustomerPaymentsView({payments}) { return <> -
-
-
-
-
-

Payments

-
-
-
-
- - - - - - - +
+
+
+

Payments

+
+
+ <> +
#FirstLastHandle
+ + + + + + + + + + {(payments && payments.length > 0) ? payments?.map((item, index) => ( + + + + + + + )) + : + + - - - - - - - - - - - - - - - - - - - - - -
+ # + + First + + Last + + Handle +
+
+
{index+1}
+
+
+
+
{item?.first}
+
+
+
+
{item?.last}
+
+
+
+
{item?.handle}
+
+
+
+ No Record Found +
+
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
-
+ } + + +
diff --git a/src/components/account_view/CustomerSubscriptionsView.jsx b/src/components/account_view/CustomerSubscriptionsView.jsx index b22bdb3..d2e7215 100644 --- a/src/components/account_view/CustomerSubscriptionsView.jsx +++ b/src/components/account_view/CustomerSubscriptionsView.jsx @@ -1,86 +1,92 @@ +import getDateTimeFromDateString from "../../helpers/getDateTimeFromDateString"; +import RouteLinks from "../../RouteLinks"; import Icons from "../Icons"; import {Link} from 'react-router-dom' -export default function CustomerSubscriptionsView() { +export default function CustomerSubscriptionsView({subscriptions, memberUID}) { return <> -
-
-
-
-
-

Subscriptions

-
-
-
-
- - - - - - - - - - - - - - - - - - - +
IDAddedProductURLStatusAction
1Sat, Sep 27th 2025 7:29AMA000002bobmarleya2.devprov.mermsemr.com7 -
-
- - - +
+
+
+

Subscriptions

+
+
+ <> + + + + + + + + + + + + + {(subscriptions && subscriptions.length > 0) ? subscriptions?.map((item, index) => ( + + + + + + + + + )) + : + + - - - - - - - - - - - - - - - - - -
+ # + + Added + + Product + + URL + + Status + + Action +
+
+
{index+1}
+
+
+
{getDateTimeFromDateString(item?.added)}
+
+
+
+
{item?.product_id}
+
+
+
+
{item?.internal_url}
+
+
+
+
{item?.status}
+
+
+
+
+ + + +
+
+
+
+ No Record Found
2Sat, Sep 27th 2025 7:29AMA000002bobmarleya2.devprov.mermsemr.com7 -
-
- - - -
-
-
3Sat, Sep 27th 2025 7:29AMA000002bobmarleya2.devprov.mermsemr.com7 -
-
- - - -
-
-
-
-
+ } +
+
diff --git a/src/components/subscription_view/SubscriptionViewCom.jsx b/src/components/subscription_view/SubscriptionViewCom.jsx index 06ee951..3a7b118 100644 --- a/src/components/subscription_view/SubscriptionViewCom.jsx +++ b/src/components/subscription_view/SubscriptionViewCom.jsx @@ -1,11 +1,24 @@ +import {useLocation, useNavigate, Link} from 'react-router-dom' import BreadcrumbCom from '../breadcrumb/BreadcrumbCom' +import { useEffect } from 'react'; export default function SubscriptionViewCom() { const subscriptionUID = "63554d40-9ba1-4afe-80c2-ca147236f7ee"; + + const {state:{memberUID}} = useLocation() + const navigate = useNavigate() + + useEffect(()=>{ + if(!memberUID){ + navigate(`/account-view/${memberUID}`, {replace: true, state:{memberUID}}) + } + },[]) + console.log('DATA0', memberUID) + return (
- +