Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!49
This commit is contained in:
commit
e833ec8fd3
|
@ -76,6 +76,22 @@ export const DetailUser = observer(() => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const withdrawProfit = async (id) => {
|
||||||
|
try {
|
||||||
|
modalLoader.setLoading(true);
|
||||||
|
const response = await store.membership.withdrawProfit(id);
|
||||||
|
modalLoader.setLoading(false);
|
||||||
|
|
||||||
|
response?.body?.statusCode === 201 || response?.body?.statusCode === 200
|
||||||
|
? message.success(`Success Withdraw Profit`)
|
||||||
|
: message.error(`Failed Withdraw Profit`);
|
||||||
|
await getData();
|
||||||
|
} catch (err) {
|
||||||
|
modalLoader.setLoading(false);
|
||||||
|
message.error(`Failed Withdraw Profit`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
data.superior = true;
|
data.superior = true;
|
||||||
setConfirmLoading(true);
|
setConfirmLoading(true);
|
||||||
|
@ -312,9 +328,8 @@ export const DetailUser = observer(() => {
|
||||||
: "primary"
|
: "primary"
|
||||||
}
|
}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
changeStatus(
|
withdrawProfit(
|
||||||
store.membership.dataDetail.id,
|
store.membership.dataDetail.id,
|
||||||
store.membership.dataDetail.isActive
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
@ -415,14 +415,13 @@ export const Membership = observer(() => {
|
||||||
>
|
>
|
||||||
<List.Item.Meta
|
<List.Item.Meta
|
||||||
className={["cariparkir-container"].join(" ")}
|
className={["cariparkir-container"].join(" ")}
|
||||||
title={item.name}
|
title={item.user_detail?.name}
|
||||||
description={
|
description={
|
||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<p>
|
<p>
|
||||||
<small>Saldo System : {item.name}</small> <br />
|
<small>Role : {item.roles?.name}</small> <br />
|
||||||
<small>Role : {item.roleName}</small> <br />
|
|
||||||
<small>
|
<small>
|
||||||
Saldo Supplier : {item.coa?.amount}
|
Saldo : {item.coa?.amount}
|
||||||
</small>{" "}
|
</small>{" "}
|
||||||
<br />
|
<br />
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -26,7 +26,7 @@ export class Membership {
|
||||||
const response = await http.get(`/users?page=${this.page}&pageSize=${this.pageSize}&superior=${this.filterMembership}&type=${this.filterPartner}`);
|
const response = await http.get(`/users?page=${this.page}&pageSize=${this.pageSize}&superior=${this.filterMembership}&type=${this.filterPartner}`);
|
||||||
console.log(this.filterMembership)
|
console.log(this.filterMembership)
|
||||||
// console.log(this.filterPartner)
|
// console.log(this.filterPartner)
|
||||||
//console.log(response)
|
console.log(response)
|
||||||
this.dataMember = response.body.data ?? []
|
this.dataMember = response.body.data ?? []
|
||||||
// this.dataMember = response.body.data.map((item, idx) => {
|
// this.dataMember = response.body.data.map((item, idx) => {
|
||||||
// item.key = idx;
|
// item.key = idx;
|
||||||
|
@ -38,7 +38,7 @@ export class Membership {
|
||||||
// }) ?? []
|
// }) ?? []
|
||||||
|
|
||||||
this.dataTotal = response?.body?.count ?? 0
|
this.dataTotal = response?.body?.count ?? 0
|
||||||
//console.log(this.dataTotal)
|
console.log(this.dataTotal)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,16 @@ export class Membership {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async withdrawProfit(id) {
|
||||||
|
try {
|
||||||
|
const response = await http.put(`/transaction/withdraw/${id}`);
|
||||||
|
await this.getData();
|
||||||
|
return response;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user