fix: detail product
This commit is contained in:
		| @@ -1,20 +1,10 @@ | |||||||
| import React, {useContext, useEffect, useState} from "react"; | import React, {useContext, useEffect, useState} from "react"; | ||||||
| import { | import {Button, Card, Col, Row, Table, Typography,} from "antd"; | ||||||
|   Button, |  | ||||||
|   Card, |  | ||||||
|   Col, |  | ||||||
|   Row, |  | ||||||
|   Table, |  | ||||||
|   Typography, |  | ||||||
|   Tag, |  | ||||||
|   Space, |  | ||||||
|   message, |  | ||||||
| } from "antd"; |  | ||||||
| import {BreadcumbComponent} from "../../component/BreadcumbComponent"; | import {BreadcumbComponent} from "../../component/BreadcumbComponent"; | ||||||
| import {LINKS} from "../../routes/app"; | import {LINKS} from "../../routes/app"; | ||||||
| import {useStore} from "../../utils/useStore"; | import {useStore} from "../../utils/useStore"; | ||||||
| import {observer} from "mobx-react-lite"; | import {observer} from "mobx-react-lite"; | ||||||
| import { FilterOutlined, DownloadOutlined } from "@ant-design/icons"; | import {FilterOutlined} from "@ant-design/icons"; | ||||||
| import {format, parseISO} from "date-fns"; | import {format, parseISO} from "date-fns"; | ||||||
| import {ModalLoaderContext} from "../../utils/modal"; | import {ModalLoaderContext} from "../../utils/modal"; | ||||||
| import {useParams} from "react-router-dom"; | import {useParams} from "react-router-dom"; | ||||||
| @@ -31,7 +21,6 @@ export const DetailUser = observer(() => { | |||||||
|   const [initialData, setInitialData] = useState({}); |   const [initialData, setInitialData] = useState({}); | ||||||
|   const [confirmLoading, setConfirmLoading] = useState(false); |   const [confirmLoading, setConfirmLoading] = useState(false); | ||||||
|  |  | ||||||
|   //console.log(id) |  | ||||||
|   useEffect(() => { |   useEffect(() => { | ||||||
|     (async () => { |     (async () => { | ||||||
|       modalLoader.setLoading(true); |       modalLoader.setLoading(true); | ||||||
| @@ -69,7 +58,11 @@ export const DetailUser = observer(() => { | |||||||
|       name: "Home", |       name: "Home", | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       route: LINKS.USER_DETAIL, |       route: "/app/membership", | ||||||
|  |       name: <span style={{fontWeight: "bold"}}>Membership</span>, | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |       route: LINKS.USER_DETAIL.replace(":id", id), | ||||||
|       name: <span style={{fontWeight: "bold"}}>Detail User</span>, |       name: <span style={{fontWeight: "bold"}}>Detail User</span>, | ||||||
|     }, |     }, | ||||||
|   ]; |   ]; | ||||||
|   | |||||||
| @@ -14,7 +14,6 @@ import { | |||||||
|   Select, |   Select, | ||||||
|   Space, |   Space, | ||||||
|   Table, |   Table, | ||||||
|   Tag, |  | ||||||
| } from "antd"; | } from "antd"; | ||||||
| import {useStore} from "../../utils/useStore"; | import {useStore} from "../../utils/useStore"; | ||||||
| import {observer} from "mobx-react-lite"; | import {observer} from "mobx-react-lite"; | ||||||
| @@ -221,9 +220,7 @@ export const Membership = observer(() => { | |||||||
|           </Button> |           </Button> | ||||||
|           <Button |           <Button | ||||||
|             onClick={async () => { |             onClick={async () => { | ||||||
|               await store.transaction.getDataHistoryTopUp(record.id); |  | ||||||
|               history.push(LINKS.USER_DETAIL.replace(":id", record.id)); |               history.push(LINKS.USER_DETAIL.replace(":id", record.id)); | ||||||
|               console.log(record.id); |  | ||||||
|             }} |             }} | ||||||
|           > |           > | ||||||
|             Detail |             Detail | ||||||
|   | |||||||
| @@ -22,11 +22,12 @@ export class Transaction { | |||||||
|     filterSubCategory = null; |     filterSubCategory = null; | ||||||
|  |  | ||||||
|     pageHistoryTransaction = 0; |     pageHistoryTransaction = 0; | ||||||
|     pageHistoryTopUp = 0; |  | ||||||
|     pageSizeHistoryTransaction = 10 |     pageSizeHistoryTransaction = 10 | ||||||
|     dataHistoryTransaction = []; |     dataHistoryTransaction = []; | ||||||
|     total_dataHistoryTransaction = 0; |     total_dataHistoryTransaction = 0; | ||||||
|  |  | ||||||
|  |     pageHistoryTopUp = 0; | ||||||
|  |     pageSizeHistoryTopUp = 10; | ||||||
|     dataHistoryTopUp = []; |     dataHistoryTopUp = []; | ||||||
|     total_dataHistoryTopUp = 0; |     total_dataHistoryTopUp = 0; | ||||||
|  |  | ||||||
| @@ -80,9 +81,7 @@ export class Transaction { | |||||||
|  |  | ||||||
|     async getDataHistoryTopUp(id) { |     async getDataHistoryTopUp(id) { | ||||||
|         try { |         try { | ||||||
|             //console.log("Top up") |             const response = await http.get(`/transaction/history-deposit?page=${this.pageHistoryTopUp}&pageSize=${this.pageSizeHistoryTopUp}&user-destination=${id}`); | ||||||
|             const response = await http.get(`/transaction/history-deposit?page=${this.pageHistoryTopUp}&user-destination=${id}`); |  | ||||||
|             //console.log(response,"data") |  | ||||||
|             this.dataHistoryTopUp = response.body.data ?? [] |             this.dataHistoryTopUp = response.body.data ?? [] | ||||||
|             this.total_dataHistoryTopUp = response?.body?.count ?? 0 |             this.total_dataHistoryTopUp = response?.body?.count ?? 0 | ||||||
|         } catch (e) { |         } catch (e) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user