Merge branch 'develop' into 'devops-production'
Bug Fixing See merge request empatnusabangsa/ppob/ppob-frontend!140
This commit is contained in:
commit
228d64b512
|
@ -312,7 +312,9 @@ export const DesktopLayout = observer(() => {
|
|||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
{store.authentication.userData.role !== "Admin" &&
|
||||
store.authentication.userData.role !==
|
||||
"Customer Service" && (
|
||||
<Menu.Item key="payback-from-user">
|
||||
<Link to={LINKS.PAYBACK_CREATED}>
|
||||
<AlipayOutlined />
|
||||
|
|
|
@ -242,7 +242,8 @@ export const MenuList = observer((props) => {
|
|||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
{store.authentication.userData.role !== "Admin" &&
|
||||
store.authentication.userData.role !== "Customer Service" && (
|
||||
<Menu.Item key="payback-from-user">
|
||||
<Link to={LINKS.PAYBACK_CREATED}>
|
||||
<FileProtectOutlined />
|
||||
|
|
|
@ -117,14 +117,14 @@ export const PaybackCreated = observer(() => {
|
|||
},
|
||||
{
|
||||
route: LINKS.PAYBACK_CREATED,
|
||||
name: <span style={{ fontWeight: "bold" }}>Buat Pembayaran</span>,
|
||||
name: <span style={{ fontWeight: "bold" }}>Bukti Pembayaran</span>,
|
||||
},
|
||||
];
|
||||
|
||||
const dataRoute = [
|
||||
{
|
||||
route: LINKS.PAYBACK_CREATED,
|
||||
name: "Buat Pembayaran",
|
||||
name: "Bukti Pembayaran",
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { message, useContext, useEffect, useState } from "react";
|
||||
import React, { useContext, useEffect, useState } from "react";
|
||||
import { useStore } from "../../utils/useStore";
|
||||
import {
|
||||
Card,
|
||||
|
@ -11,8 +11,10 @@ import {
|
|||
Row,
|
||||
DatePicker,
|
||||
Form,
|
||||
Input,
|
||||
message,
|
||||
Input
|
||||
} from "antd";
|
||||
|
||||
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||
import { Product } from "./Product";
|
||||
import { LINKS } from "../../routes/app";
|
||||
|
@ -89,6 +91,7 @@ export const Transaction = observer(() => {
|
|||
} else {
|
||||
message.error(response?.body?.error || "Gagal Beli Produk", 3);
|
||||
}
|
||||
setVisibleModalBuy(false);
|
||||
} catch (e) {
|
||||
console.log("testingan");
|
||||
console.log(e.response, "testingan");
|
||||
|
@ -102,40 +105,43 @@ export const Transaction = observer(() => {
|
|||
console.log(e, "apa errornya");
|
||||
message.error("Gagal Beli Product");
|
||||
}
|
||||
// message.success("Berhasil Beli Produk");
|
||||
setVisibleModalBuy(false);
|
||||
modalLoader.setLoading(false);
|
||||
};
|
||||
|
||||
const handleBuyStag = async (data, productCode) => {
|
||||
modalLoader.setLoading(true);
|
||||
try {
|
||||
const response = await store.transaction.buyProduct({
|
||||
...data,
|
||||
productCode: productCode,
|
||||
});
|
||||
if (response.status === 201) {
|
||||
message.success(response?.body?.message || "Berhasil Beli Produk");
|
||||
} else {
|
||||
message.error(response?.body?.error || "Gagal Beli Produk", 3);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("testingan");
|
||||
console.log(e.response, "testingan");
|
||||
console.log(e.result, "testingan1");
|
||||
if (e.response?.body?.error) {
|
||||
message.error(e.response.body.error);
|
||||
setVisibleModalBuy(false);
|
||||
modalLoader.setLoading(false);
|
||||
return;
|
||||
}
|
||||
console.log(e, "apa errornya");
|
||||
message.error("Gagal Beli Product");
|
||||
}
|
||||
// setDataProd(false);
|
||||
// setDataStag(false);
|
||||
setVisibleModalBuy(false);
|
||||
modalLoader.setLoading(false);
|
||||
};
|
||||
// const handleBuyStag = async (data, productCode) => {
|
||||
// modalLoader.setLoading(true);
|
||||
// try {
|
||||
// const response = await store.transaction.buyProduct({
|
||||
// ...data,
|
||||
// productCode: productCode,
|
||||
// });
|
||||
// if (response.status === 201) {
|
||||
// message.success(response?.body?.message || "Berhasil Beli Produk");
|
||||
// } else {
|
||||
// message.error(response?.body?.error || "Gagal Beli Produk", 3);
|
||||
// }
|
||||
// } catch (e) {
|
||||
// console.log("testingan");
|
||||
// console.log(e.response, "testingan");
|
||||
// console.log(e.result, "testingan1");
|
||||
// if (e.response?.body?.error) {
|
||||
// message.error(e.response.body.error);
|
||||
// setVisibleModalBuy(false);
|
||||
// modalLoader.setLoading(false);
|
||||
// return;
|
||||
// }
|
||||
// console.log(e, "apa errornya");
|
||||
// message.error("Gagal Beli Product");
|
||||
// }
|
||||
// // setDataProd(false);
|
||||
// // setDataStag(false);
|
||||
// setVisibleModalBuy(false);
|
||||
// modalLoader.setLoading(false);
|
||||
// };
|
||||
|
||||
|
||||
const handleCancel = () => {
|
||||
form.resetFields();
|
||||
setVisibleModalBuy(false);
|
||||
|
@ -241,6 +247,7 @@ export const Transaction = observer(() => {
|
|||
onClick={() => {
|
||||
setVisibleModalBuy(true);
|
||||
setBarang(item);
|
||||
console.log(item?.product_name)
|
||||
}}
|
||||
hoverable
|
||||
style={{
|
||||
|
|
Loading…
Reference in New Issue
Block a user