update
This commit is contained in:
@ -38,7 +38,8 @@ const ApprovalDialog = () => {
|
||||
|
||||
const [formField, setFormField] = useState({
|
||||
transaction_code: '',
|
||||
status: ''
|
||||
status: '',
|
||||
notes: ''
|
||||
});
|
||||
|
||||
const [alert, setAlert] = useState({
|
||||
@ -61,8 +62,9 @@ const ApprovalDialog = () => {
|
||||
}
|
||||
|
||||
const response = await PostData(`${API_URL}/transaction/set-approval`, {
|
||||
transaction_code: transactionDetails.code,
|
||||
transaction_code: transactionDetails.id,
|
||||
status: formField.status,
|
||||
notes: formField.notes
|
||||
});
|
||||
|
||||
if (response?.status) {
|
||||
@ -119,8 +121,8 @@ const ApprovalDialog = () => {
|
||||
|
||||
<div className="grow">
|
||||
<Select
|
||||
value={formField.status}
|
||||
onValueChange={(status) => setFormField((prev) => ({ ...prev, status }))}
|
||||
value={formField.status}
|
||||
onValueChange={(status) => setFormField((prev) => ({ ...prev, status }))}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select" />
|
||||
@ -132,8 +134,21 @@ const ApprovalDialog = () => {
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{formField.status === 'N' && (
|
||||
<div className="flex items-center flex-wrap gap-2.5 mt-4">
|
||||
<label className="form-label max-w-56">Notes</label>
|
||||
|
||||
<div className="grow">
|
||||
<textarea
|
||||
name="notes"
|
||||
id="notes"
|
||||
value={formField.notes}
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<div className="flex justify-end">
|
||||
|
||||
@ -203,6 +203,7 @@ const ApprovalTransactionProvider = ({ children }: { children: React.ReactNode }
|
||||
setSelectedTransactionIdForApproval(row.id);
|
||||
setShowApprovalDialog(true);
|
||||
}}
|
||||
disabled={row.status_approve === 'Y' || row.status_approve === 'N'}
|
||||
>
|
||||
<KeenIcon icon="notepad-edit" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user