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