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