) => {
e.preventDefault();
const response = await PutData(`${API_URL}/transactionfees/update/${selectedTransferFee}`, {
- ...formField
+ ...formField,
+ priority: formField.priority ? 'Y' : 'N' // Ubah ke "Y" atau "N"
});
if (response?.status) {
handleEditFeeDialog(false, null);
@@ -165,9 +166,10 @@ const EditFeeDialog = () => {
order_field: sorting[0].id,
order_direction: sorting[0].desc ? 'DESC' : 'ASC'
});
- setTransactionTypes(response?.data.list || []);
+ // console.log('Transaction Type: ', response?.data.list);
+ setTransactionTypes(response?.data.list);
} catch (error) {
- console.error('Error fetching customer', error);
+ console.error('Error fetching Transaction Type', error);
}
};
@@ -188,29 +190,10 @@ const EditFeeDialog = () => {
period_end: response.data.period_end,
deduct_amount: response.data.deduct_amount,
deduct_percentage: response.data.deduct_percentage,
- priority: response.data.priority,
+ priority: response.data.priority === 'Y',
status: response.data.status,
status_include: response.data.status_include,
transaction_type: response.data.transaction_type.id
-
- // updated_by: parsedUser?.username ,
- // updated_at: new Date().toISOString().slice(0, 19).replace('T', ' ')
- }));
- } else {
- setFormField((prev) => ({
- ...prev,
- name: '',
- description: '',
- minimum_amount: 0,
- maximum_amount: 0,
- period_start: '',
- period_end: '',
- deduct_amount: 0,
- deduct_percentage: 0,
- priority: '',
- status: '',
- status_include: '',
- transaction_type: ''
}));
}
}, []);
@@ -230,7 +213,7 @@ const EditFeeDialog = () => {
period_end: '',
deduct_amount: 0,
deduct_percentage: 0,
- priority: '',
+ priority: false,
status: '',
status_include: '',
transaction_type: '',
@@ -416,8 +399,8 @@ const EditFeeDialog = () => {
- Y
- N
+ Active
+ Inactive
@@ -433,26 +416,29 @@ const EditFeeDialog = () => {
- Y
- N
+ Yes
+ No
+
{/*
-
+
-
- {/*
-
-
*/}
- {/* */}
-