add field purpose on disbursement saldo
This commit is contained in:
@ -16,10 +16,12 @@ const TransactionDisbursement = () => {
|
|||||||
msisdn: string;
|
msisdn: string;
|
||||||
amount: string;
|
amount: string;
|
||||||
pin: string;
|
pin: string;
|
||||||
|
purpose: string;
|
||||||
} = {
|
} = {
|
||||||
msisdn: '',
|
msisdn: '',
|
||||||
amount: '',
|
amount: '',
|
||||||
pin: ''
|
pin: '',
|
||||||
|
purpose: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
const [form, setForm] = useState(initialForm);
|
const [form, setForm] = useState(initialForm);
|
||||||
@ -104,6 +106,7 @@ const TransactionDisbursement = () => {
|
|||||||
let response = await PostData(`${API_URL}/transaction/topup-downline`, {
|
let response = await PostData(`${API_URL}/transaction/topup-downline`, {
|
||||||
msisdn_destination: form.msisdn,
|
msisdn_destination: form.msisdn,
|
||||||
amount: form.amount,
|
amount: form.amount,
|
||||||
|
purpose: form.purpose,
|
||||||
pin: form.pin
|
pin: form.pin
|
||||||
});
|
});
|
||||||
if (response?.status == true) {
|
if (response?.status == true) {
|
||||||
@ -134,9 +137,9 @@ const TransactionDisbursement = () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(form);
|
||||||
setAlert({ show: false, message: '' });
|
setAlert({ show: false, message: '' });
|
||||||
setShowConfirmation(true);
|
setShowConfirmation(true);
|
||||||
// TODO: Kirim ke backend atau proses lainnya
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ResetForm = () => {
|
const ResetForm = () => {
|
||||||
@ -283,6 +286,21 @@ const TransactionDisbursement = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label htmlFor="purpose">
|
||||||
|
Purpose <span className="text-gray-500 text-sm">(optional)</span>
|
||||||
|
</label>
|
||||||
|
<Input
|
||||||
|
id="purpose"
|
||||||
|
type="text"
|
||||||
|
value={form.purpose}
|
||||||
|
onChange={(e) => {
|
||||||
|
setForm({ ...form, purpose: e.target.value });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="pin">PIN</label>
|
<label htmlFor="pin">PIN</label>
|
||||||
<span className="text-red-500">*</span>
|
<span className="text-red-500">*</span>
|
||||||
@ -293,6 +311,7 @@ const TransactionDisbursement = () => {
|
|||||||
onChange={(e) => setForm({ ...form, pin: e.target.value })}
|
onChange={(e) => setForm({ ...form, pin: e.target.value })}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Button type="button" onClick={handleSubmit}>
|
<Button type="button" onClick={handleSubmit}>
|
||||||
Submit
|
Submit
|
||||||
|
|||||||
Reference in New Issue
Block a user