From 2cc6dc53c0a0d81d6de26653b42f913c6685393d Mon Sep 17 00:00:00 2001 From: caturbgs Date: Thu, 16 Dec 2021 11:12:32 +0700 Subject: [PATCH 1/3] fix: stiching API profile and last history --- src/pages/Profile/Profile.js | 52 ++++++++++++++++++------------------ src/store/authentication.js | 2 +- src/store/transaction.js | 4 +-- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/pages/Profile/Profile.js b/src/pages/Profile/Profile.js index 5f39827..5d851ec 100644 --- a/src/pages/Profile/Profile.js +++ b/src/pages/Profile/Profile.js @@ -57,32 +57,32 @@ export const Profile = observer(() => {
Profile - {/**/} - {/* */} - {/* Name*/} - {/* */} - {/* */} - {/* {store.authentication.profileData.username}*/} - {/* */} - {/* */} - {/* Role*/} - {/* */} - {/* */} - {/* {store.authentication.profileData.roles.name}*/} - {/* */} - {/* */} - {/* Superior*/} - {/* */} - {/* */} - {/* {store.authentication.profileData.superior.username}*/} - {/* */} - {/* */} - {/* Wallet*/} - {/* */} - {/* */} - {/* {store.authentication.profileData.wallet}*/} - {/* */} - {/**/} + + + Name + + + {store.authentication.profileData?.username} + + + Role + + + {store.authentication.profileData.roles?.name} + + + Superior + + + {store.authentication.profileData.superior?.username} + + + Wallet + + + {store.authentication.profileData.wallet} + +
diff --git a/src/store/authentication.js b/src/store/authentication.js index 526f512..eb541b0 100644 --- a/src/store/authentication.js +++ b/src/store/authentication.js @@ -53,7 +53,7 @@ export class Authentication { async getProfile() { try { const response = await http.get('/auth/profile'); - this.profileData = response.body.data; + this.profileData = response.body; } catch (e) { console.error(e); throw e; diff --git a/src/store/transaction.js b/src/store/transaction.js index 50cd379..63b8c31 100644 --- a/src/store/transaction.js +++ b/src/store/transaction.js @@ -20,7 +20,7 @@ export class Transaction { total_dataSubCategories = 0; pageHistoryTransaction = 0; - pageSizeHistoryTransaction = 10 + // pageSizeHistoryTransaction = 10 dataHistoryTransaction = []; total_dataHistoryTransaction = 0; @@ -53,7 +53,7 @@ export class Transaction { } async getDataHistoryTransaction() { - const response = await http.get(`/transaction/history?page=${this.pageHistoryTransaction}&pageSize=${this.pageSizeHistoryTransaction}`); + const response = await http.get(`/transaction/history?page=${this.pageHistoryTransaction}`); this.dataHistoryTransaction = response.body.data ?? [] this.total_dataHistoryTransaction = response.body.total_data ?? 0 From 19ef0eee64df3745093ad87592ee9c44b6889253 Mon Sep 17 00:00:00 2001 From: caturbgs Date: Thu, 16 Dec 2021 12:32:55 +0700 Subject: [PATCH 2/3] feat: change layout profile page --- src/pages/Profile/Profile.js | 58 +++++++++++++++++------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/pages/Profile/Profile.js b/src/pages/Profile/Profile.js index 5d851ec..6eb391f 100644 --- a/src/pages/Profile/Profile.js +++ b/src/pages/Profile/Profile.js @@ -53,36 +53,34 @@ export const Profile = observer(() => {
+ Profile - -
- Profile - - - Name - - - {store.authentication.profileData?.username} - - - Role - - - {store.authentication.profileData.roles?.name} - - - Superior - - - {store.authentication.profileData.superior?.username} - - - Wallet - - - {store.authentication.profileData.wallet} - - + + + + Name + + + {store.authentication.profileData?.username} + + + Role + + + {store.authentication.profileData.roles?.name} + + + Superior + + + {store.authentication.profileData.superior?.username} + + + + +
+ Saldo + {store.authentication.profileData?.wallet}
@@ -92,7 +90,7 @@ export const Profile = observer(() => { History User Transaction From e206c0e221cf402642b227e01b1b490672656a15 Mon Sep 17 00:00:00 2001 From: caturbgs Date: Thu, 16 Dec 2021 12:36:42 +0700 Subject: [PATCH 3/3] feat: add filter button last history transaction --- src/pages/Profile/Profile.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/Profile/Profile.js b/src/pages/Profile/Profile.js index 6eb391f..3855740 100644 --- a/src/pages/Profile/Profile.js +++ b/src/pages/Profile/Profile.js @@ -1,9 +1,10 @@ import React, {useEffect} from "react"; -import {Card, Col, Row, Table, Typography} 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} from "@ant-design/icons"; const {Title, Text} = Typography; @@ -88,9 +89,16 @@ export const Profile = observer(() => {
History User Transaction + +