Perbaikan Project PPOB
This commit is contained in:
parent
6201ce4ad0
commit
c95bd3eca3
|
@ -41,6 +41,7 @@ export const DetailUser = observer(() => {
|
||||||
return () => {
|
return () => {
|
||||||
store.membership.dataDetail = {};
|
store.membership.dataDetail = {};
|
||||||
store.transaction.dataHistoryTopUp = [];
|
store.transaction.dataHistoryTopUp = [];
|
||||||
|
store.authentication.dataProfit = [];
|
||||||
store.transaction.dataDetailHistoryTransaction = [];
|
store.transaction.dataDetailHistoryTransaction = [];
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -49,6 +50,7 @@ export const DetailUser = observer(() => {
|
||||||
const isAdmin = store.authentication.userData.role === "Admin";
|
const isAdmin = store.authentication.userData.role === "Admin";
|
||||||
await Promise.allSettled([
|
await Promise.allSettled([
|
||||||
store.transaction.getDataHistoryTopUp(id),
|
store.transaction.getDataHistoryTopUp(id),
|
||||||
|
store.authentication.getProfit(id),
|
||||||
store.transaction.getDetailHistoryTransaction(id),
|
store.transaction.getDetailHistoryTransaction(id),
|
||||||
store.membership.getDetail(id),
|
store.membership.getDetail(id),
|
||||||
store.role.getData(isAdmin),
|
store.role.getData(isAdmin),
|
||||||
|
@ -313,26 +315,26 @@ export const DetailUser = observer(() => {
|
||||||
<Text strong>Name</Text>
|
<Text strong>Name</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>{store.membership.dataDetail.userDetail?.name}</Text>
|
<Text>{store.authentication.dataProfit.userDetail?.name}</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Username</Text>
|
<Text strong>Username</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>{store.membership.dataDetail.username}</Text>
|
<Text>{store.authentication.dataProfit.username}</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Role</Text>
|
<Text strong>Role</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>{store.membership.dataDetail.roles?.name}</Text>
|
<Text>{store.authentication.dataProfit.roles?.name}</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Phone Number</Text>
|
<Text strong>Phone Number</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>
|
<Text>
|
||||||
{store.membership.dataDetail.userDetail?.phone_number}
|
{store.authentication.dataProfit.userDetail?.phone_number}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
|
@ -340,7 +342,7 @@ export const DetailUser = observer(() => {
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>
|
<Text>
|
||||||
{store.membership.dataDetail.isActive === true
|
{store.authentication.dataProfit.isActive === true
|
||||||
? "Aktif"
|
? "Aktif"
|
||||||
: "Inaktif"}
|
: "Inaktif"}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -364,7 +366,7 @@ export const DetailUser = observer(() => {
|
||||||
style: "currency",
|
style: "currency",
|
||||||
currency: "IDR",
|
currency: "IDR",
|
||||||
}).format(
|
}).format(
|
||||||
store.authentication.profileData?.wallet || 0
|
store.authentication.dataProfit.wallet || 0
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
@ -222,6 +222,7 @@ export const Membership = observer(() => {
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await store.transaction.getDataHistoryTopUp(record.id);
|
await store.transaction.getDataHistoryTopUp(record.id);
|
||||||
await store.transaction.getDetailHistoryTransaction(record.id);
|
await store.transaction.getDetailHistoryTransaction(record.id);
|
||||||
|
await store.authentication.getProfit(record.id);
|
||||||
//await store.transaction.getDataHistoryTransaction()
|
//await store.transaction.getDataHistoryTransaction()
|
||||||
history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
history.push(LINKS.USER_DETAIL.replace(":id", record.id));
|
||||||
console.log(record.id);
|
console.log(record.id);
|
||||||
|
|
|
@ -8,6 +8,7 @@ export class Authentication {
|
||||||
isLoginLoading = false;
|
isLoginLoading = false;
|
||||||
ctx;
|
ctx;
|
||||||
profileData = {};
|
profileData = {};
|
||||||
|
dataProfit=[]
|
||||||
|
|
||||||
constructor(ctx) {
|
constructor(ctx) {
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
|
@ -51,6 +52,17 @@ export class Authentication {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getProfit(id) {
|
||||||
|
try {
|
||||||
|
const response = await http.get(`/auth/profile/${id}`);
|
||||||
|
console.log(response)
|
||||||
|
this.dataProfit = response.body ?? [];
|
||||||
|
this.total_data = response?.body?.count ?? 0;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async getProfile() {
|
async getProfile() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get('/auth/profile');
|
const response = await http.get('/auth/profile');
|
||||||
|
|
|
@ -40,6 +40,7 @@ export class Transaction {
|
||||||
dataTransactionB2B = [];
|
dataTransactionB2B = [];
|
||||||
dataTransactionPartner = [];
|
dataTransactionPartner = [];
|
||||||
|
|
||||||
|
|
||||||
//filter
|
//filter
|
||||||
visibleModalFilterTransaction = false;
|
visibleModalFilterTransaction = false;
|
||||||
filterStart = null;
|
filterStart = null;
|
||||||
|
@ -51,6 +52,7 @@ export class Transaction {
|
||||||
makeAutoObservable(this);
|
makeAutoObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async getData() {
|
async getData() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(
|
const response = await http.get(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user