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