fixing transasction type and transaction fee
This commit is contained in:
@ -150,9 +150,7 @@ const AddFeeDialog = () => {
|
||||
e.preventDefault();
|
||||
for (const key in formField) {
|
||||
if (
|
||||
formField[key as keyof typeof formField] === '' ||
|
||||
formField[key as keyof typeof formField] === 0
|
||||
) {
|
||||
formField[key as keyof typeof formField] === '' ) {
|
||||
setAlert({ show: true, message: 'All fields must be filled out' });
|
||||
return;
|
||||
}
|
||||
@ -163,7 +161,7 @@ const AddFeeDialog = () => {
|
||||
...formField
|
||||
});
|
||||
if (response?.status) {
|
||||
toast.success('Success Create Transfer Fee');
|
||||
// toast.success('Success Create Transfer Fee');
|
||||
reload();
|
||||
resetForm();
|
||||
handleAddFeeDialog(false);
|
||||
@ -225,7 +223,7 @@ const AddFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Minimum Amount <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">Minimum Amount</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.minimum_amount}
|
||||
@ -242,7 +240,7 @@ const AddFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Maximum Amount <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">Maximum Amount</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.maximum_amount}
|
||||
@ -283,7 +281,7 @@ const AddFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Deduct Amount <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">Deduct Amount</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.deduct_amount}
|
||||
@ -300,7 +298,7 @@ const AddFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Deduct Percentage <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">Deduct Percentage</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.deduct_percentage}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle , DialogDescription} from '@/components/ui/dialog';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Alert, useDataGrid } from '@/components';
|
||||
import { useCallback, useState } from 'react';
|
||||
@ -6,7 +6,6 @@ import { apiConfig } from '@/config/api.config';
|
||||
import { toast } from 'sonner';
|
||||
import { useCallApi } from '@/hooks';
|
||||
import { useManageTransferFeeContext } from '../hooks/useManageTransferFeeContext';
|
||||
import { DialogDescription } from '@radix-ui/react-dialog';
|
||||
|
||||
const API_URL = apiConfig.service_transaction;
|
||||
|
||||
@ -27,10 +26,10 @@ const DeleteDialog = () => {
|
||||
if (response?.status) {
|
||||
setAlert({ show: false, message: '' });
|
||||
handleDeleteFeeDialog(false, null);
|
||||
toast.success('Success Delete Product');
|
||||
// toast.success('Success Delete Transaction Fee');
|
||||
reload();
|
||||
} else {
|
||||
toast.error('Failed Delete Product');
|
||||
// toast.error('Failed Delete Transaction Fee');
|
||||
setAlert({ show: true, message: response?.message });
|
||||
}
|
||||
}, [selectedTransferFee]);
|
||||
|
||||
@ -96,10 +96,11 @@ const EditFeeDialog = () => {
|
||||
async (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
const response = await PutData(`${API_URL}/transactionfees/update/${selectedTransferFee}`, {
|
||||
...formField, });
|
||||
...formField
|
||||
});
|
||||
if (response?.status) {
|
||||
handleEditFeeDialog(false, null);
|
||||
toast.success('Success Update User');
|
||||
// toast.success('Success Update Transaction Fee');
|
||||
reload();
|
||||
} else {
|
||||
setAlert((prev) => ({ ...prev, show: true, message: response?.message }));
|
||||
@ -252,7 +253,9 @@ const EditFeeDialog = () => {
|
||||
<div className="card flex flex-col gap-5">
|
||||
<div className="card-body grid gap-5 p-0">
|
||||
<div className="w-full">
|
||||
<label className="form-label">Transfer Free Name <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Transfer Free Name <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
className="input"
|
||||
type="text"
|
||||
@ -264,7 +267,9 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Description <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Description <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
className="input"
|
||||
type="text"
|
||||
@ -276,7 +281,9 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Minimum Amount <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Minimum Amount
|
||||
</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.minimum_amount}
|
||||
@ -293,7 +300,9 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Maximum Amount <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Maximum Amount
|
||||
</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.maximum_amount}
|
||||
@ -310,7 +319,9 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Period Start <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Period Start <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
className="input"
|
||||
type="date"
|
||||
@ -322,7 +333,9 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Period End <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Period End <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
className="input"
|
||||
type="date"
|
||||
@ -334,7 +347,8 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Deduct Amount <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Deduct Amount</label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.deduct_amount}
|
||||
@ -351,7 +365,8 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Deduct Percentage <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Deduct Percentage </label>
|
||||
<NumericFormat
|
||||
className="input"
|
||||
value={formField.deduct_percentage}
|
||||
@ -368,7 +383,9 @@ const EditFeeDialog = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Transacsion Type ID <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Transacsion Type ID <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Select
|
||||
value={formField.transaction_type}
|
||||
onValueChange={(transaction_type) =>
|
||||
@ -388,7 +405,9 @@ const EditFeeDialog = () => {
|
||||
</Select>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Status <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Status <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Select
|
||||
value={formField.status}
|
||||
onValueChange={(value) => setFormField({ ...formField, status: value })}
|
||||
@ -403,7 +422,9 @@ const EditFeeDialog = () => {
|
||||
</Select>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Status Included <span className="text-red-500">*</span></label>
|
||||
<label className="form-label">
|
||||
Status Included <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Select
|
||||
value={formField.status_include}
|
||||
onValueChange={(value) =>
|
||||
@ -420,20 +441,22 @@ const EditFeeDialog = () => {
|
||||
</Select>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="form-label">Priority <span className="text-red-500">*</span></label>
|
||||
<Select
|
||||
value={formField.priority}
|
||||
onValueChange={(value) => setFormField({ ...formField, priority: value })}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select Priority" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="Y">Yes</SelectItem>
|
||||
<SelectItem value="N">No</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<label className="form-label">
|
||||
Priority <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Select
|
||||
value={formField.priority}
|
||||
onValueChange={(value) => setFormField({ ...formField, priority: value })}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select Priority" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="Y">Yes</SelectItem>
|
||||
<SelectItem value="N">No</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{/* <div className="w-full">
|
||||
<label className="form-label">Priotity <span className="text-red-500">*</span></label>
|
||||
|
||||
Reference in New Issue
Block a user