diff --git a/src/component/SupplierComponent.js b/src/component/SupplierComponent.js
index 9c98998..18e9152 100644
--- a/src/component/SupplierComponent.js
+++ b/src/component/SupplierComponent.js
@@ -10,6 +10,7 @@ import {
Space,
Table,
Tag,
+ InputNumber,
} from "antd";
import { observer } from "mobx-react-lite";
import { ExclamationCircleOutlined } from "@ant-design/icons";
@@ -37,13 +38,13 @@ export const SupplierComponent = observer((props) => {
setIdData(data.id);
};
- const handleTopup = (data) => {
- console.log(data, "isi data");
+ const handleTopup = async (data) => {
+ store.supplier.code = data.code;
+ console.log(data.code, "isi data");
form.setFieldsValue({
code: data.code,
});
store.supplier.visibleModalTransaction = true;
- store.supplier.code = data.code;
};
const changeStatus = async (id, isActive) => {
@@ -163,7 +164,27 @@ export const SupplierComponent = observer((props) => {
});
};
+ const handleCancelTransaction = () => {
+ store.supplier.visibleModalTransaction = false;
+ };
+
+ const handleSubmitTransaction = async (data) => {
+ try {
+ modalLoader.setLoading(true);
+ const response = await store.supplier.createTransaction(data);
+ message.success(response?.body?.message || "Success Top Up");
+ } catch (e) {
+ console.log(e, "apa errornya");
+ message.error(e.response?.body?.message || "Failed Top Up");
+ }
+
+ modalLoader.setLoading(false);
+ store.supplier.visibleModalTransaction = false;
+ form.resetFields();
+ };
+
const handleCancel = () => {
+ form.resetFields();
setIdData("");
store.supplier.visibleModalSupplier = false;
};
@@ -350,7 +371,6 @@ export const SupplierComponent = observer((props) => {
okText={idData ? "Edit" : "Buat"}
cancelText="Batal"
onCancel={() => {
- form.resetFields();
handleCancel();
}}
onOk={() => {
@@ -420,7 +440,54 @@ export const SupplierComponent = observer((props) => {
)}
-
Total Penjualan :{" "}
@@ -108,7 +108,7 @@ export const Home = observer(() => {