diff --git a/src/auth/pages/jwt/Login.tsx b/src/auth/pages/jwt/Login.tsx
index 28a283f..f8c0a64 100644
--- a/src/auth/pages/jwt/Login.tsx
+++ b/src/auth/pages/jwt/Login.tsx
@@ -9,6 +9,7 @@ import { useAuthContext } from '@/auth';
import { useLayout } from '@/providers';
import { Alert } from '@/components';
import moment from 'moment';
+import { Helmet } from 'react-helmet';
const loginSchema = Yup.object().shape({
username: Yup.string().required('Username is required'),
@@ -76,101 +77,106 @@ const Login = () => {
};
return (
-
+ >
);
};
diff --git a/src/auth/pages/jwt/reset-password/ResetPassword.tsx b/src/auth/pages/jwt/reset-password/ResetPassword.tsx
index f8db220..857219c 100644
--- a/src/auth/pages/jwt/reset-password/ResetPassword.tsx
+++ b/src/auth/pages/jwt/reset-password/ResetPassword.tsx
@@ -9,6 +9,7 @@ import { useAuthContext } from '@/auth/useAuthContext';
import { Alert, KeenIcon } from '@/components';
import { useLayout } from '@/providers';
import { AxiosError } from 'axios';
+import { Helmet } from 'react-helmet';
const initialValues = {
email: ''
@@ -64,70 +65,75 @@ const ResetPassword = () => {
}
});
return (
-
-
+
+ >
);
};
diff --git a/src/pages/master/products/blocks/AddDialog.tsx b/src/pages/master/products/blocks/AddDialog.tsx
index 0a5e192..6c58950 100644
--- a/src/pages/master/products/blocks/AddDialog.tsx
+++ b/src/pages/master/products/blocks/AddDialog.tsx
@@ -23,6 +23,7 @@ import {
SelectValue
} from '@/components/ui/select';
import { doSaveLogActivity } from '@/actions/GlobalActions';
+import { NumericFormat } from 'react-number-format';
interface ProviderProps {
provider_id: number;
@@ -40,15 +41,29 @@ const AddDialog = () => {
show: false,
message: ''
});
- const initialState = {
+ const initialState: {
+ name: string;
+ code: string;
+ type: string;
+ description: string;
+ price_point: string | number | null;
+ price_cash: string | number | null;
+ cashback_point: string | number | null;
+ cashback_cash: string | number | null;
+ status: string;
+ provider: string;
+ process_on_third_party: string;
+ created_by: string;
+ created_at: string;
+ } = {
name: '',
code: '',
type: '',
description: '',
- price_point: 0,
- price_cash: 0,
- cashback_point: 0,
- cashback_cash: 0,
+ price_point: null,
+ price_cash: null,
+ cashback_point: null,
+ cashback_cash: null,
status: '',
provider: '',
process_on_third_party: '',
@@ -117,11 +132,13 @@ const AddDialog = () => {
formField.type.trim() === '' ||
formField.code.trim() === '' ||
formField.description.trim() === '' ||
- formField.price_point === 0 ||
- formField.price_cash === 0 ||
- formField.cashback_point === 0 ||
- formField.cashback_cash === 0 ||
+ formField.price_point === null ||
+ formField.price_cash === null ||
+ formField.cashback_point === null ||
+ formField.cashback_cash === null ||
formField.status.trim() === '' ||
+ formField.provider.trim() === '' ||
+ formField.process_on_third_party.trim() === '' ||
formField.created_by.trim() === '' ||
formField.created_at.trim() === ''
) {
@@ -234,19 +251,19 @@ const AddDialog = () => {
- {
- const value = parseFloat(e.target.value);
- setFormField({
- ...formField,
- price_point: isNaN(value) ? 0 : value
- });
+ value={formField.price_point ?? ''}
+ thousandSeparator="."
+ decimalSeparator=","
+ allowNegative={false}
+ onValueChange={(values) => {
+ setFormField((prev) => ({
+ ...prev,
+ price_point: values.floatValue !== undefined ? values.floatValue : ''
+ }));
}}
+ placeholder="Enter Price Point"
/>
@@ -256,19 +273,19 @@ const AddDialog = () => {
- {
- const value = parseFloat(e.target.value);
- setFormField({
- ...formField,
- price_cash: isNaN(value) ? 0 : value
- });
+ value={formField.price_cash ?? ''}
+ thousandSeparator="."
+ decimalSeparator=","
+ allowNegative={false}
+ onValueChange={(values) => {
+ setFormField((prev) => ({
+ ...prev,
+ price_cash: values.floatValue !== undefined ? values.floatValue : ''
+ }));
}}
+ placeholder="Enter Price Cash"
/>
@@ -278,19 +295,19 @@ const AddDialog = () => {
- {
- const value = parseFloat(e.target.value);
- setFormField({
- ...formField,
- cashback_point: isNaN(value) ? 0 : value
- });
+ value={formField.cashback_point ?? ''}
+ thousandSeparator="."
+ decimalSeparator=","
+ allowNegative={false}
+ onValueChange={(values) => {
+ setFormField((prev) => ({
+ ...prev,
+ cashback_point: values.floatValue !== undefined ? values.floatValue : ''
+ }));
}}
+ placeholder="Enter Cashback Point"
/>
@@ -300,19 +317,19 @@ const AddDialog = () => {
- {
- const value = parseFloat(e.target.value);
- setFormField({
- ...formField,
- cashback_cash: isNaN(value) ? 0 : value
- });
+ value={formField.cashback_cash ?? ''}
+ thousandSeparator="."
+ decimalSeparator=","
+ allowNegative={false}
+ onValueChange={(values) => {
+ setFormField((prev) => ({
+ ...prev,
+ cashback_cash: values.floatValue !== undefined ? values.floatValue : ''
+ }));
}}
+ placeholder="Enter Cashback Cash"
/>
diff --git a/src/pages/master/provider/blocks/AddDialog.tsx b/src/pages/master/provider/blocks/AddDialog.tsx
index c49d056..3bbf91b 100644
--- a/src/pages/master/provider/blocks/AddDialog.tsx
+++ b/src/pages/master/provider/blocks/AddDialog.tsx
@@ -68,7 +68,7 @@ const AddDialog = () => {
type: string;
status: string;
transaction_type: string;
- agent: string;
+ agent: string | null;
created_by: string;
created_at: string;
} = {
@@ -77,7 +77,7 @@ const AddDialog = () => {
type: '',
status: '',
transaction_type: '',
- agent: '',
+ agent: null,
created_by: '',
created_at: ''
};
@@ -133,7 +133,7 @@ const AddDialog = () => {
return;
}
- console.log(formField);
+ // console.log(formField);
doCreateProvider(e);
setAlert({ show: false, message: '' });
};
diff --git a/src/pages/master/provider/blocks/EditDialog.tsx b/src/pages/master/provider/blocks/EditDialog.tsx
index 31af42b..85959e4 100644
--- a/src/pages/master/provider/blocks/EditDialog.tsx
+++ b/src/pages/master/provider/blocks/EditDialog.tsx
@@ -58,7 +58,7 @@ const EditDialog = () => {
type: string;
status: string;
transaction_type: string;
- agent: string;
+ agent: string | null;
updated_by: string;
updated_at: string;
} = {
@@ -67,7 +67,7 @@ const EditDialog = () => {
type: '',
status: '',
transaction_type: '',
- agent: '',
+ agent: null,
updated_by: '',
updated_at: ''
};
@@ -156,7 +156,7 @@ const EditDialog = () => {
type: response?.data.type,
status: response?.data.status,
transaction_type: response?.data.transaction_type.id,
- agent: response?.data.agent?.id || ''
+ agent: response?.data.agent?.id || null
}));
}
}, []);
@@ -169,8 +169,7 @@ const EditDialog = () => {
formField.description.trim() === '' ||
formField.type.trim() === '' ||
formField.status.trim() === '' ||
- formField.transaction_type.trim() === '' ||
- formField.agent.trim() === ''
+ formField.transaction_type.trim() === ''
) {
setAlert({ show: true, message: 'Please fill in all required fields.' });
return;
diff --git a/src/pages/master/walletRule/blocks/AddDialog.tsx b/src/pages/master/walletRule/blocks/AddDialog.tsx
index 0e5ce46..043f766 100644
--- a/src/pages/master/walletRule/blocks/AddDialog.tsx
+++ b/src/pages/master/walletRule/blocks/AddDialog.tsx
@@ -123,7 +123,16 @@ const AddDialog = () => {
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
- if (formField.id_group.trim() === '' || formField.status.trim() === '') {
+ if (
+ formField.id_group.trim() === '' ||
+ formField.status.trim() === '' ||
+ formField.id_wallet.trim() === '' ||
+ formField.max_transaction_per_day === null ||
+ formField.balance_minimum === null ||
+ formField.balance_maximum === null ||
+ formField.credit_limit === null ||
+ formField.monthly_limit === null
+ ) {
setAlert({ show: true, message: 'Please fill in all required fields.' });
return;
}
diff --git a/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx b/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx
index 5564f0d..fb4536c 100644
--- a/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx
+++ b/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx
@@ -155,7 +155,7 @@ const ApprovalTransactionProvider = ({ children }: { children: React.ReactNode }
},
{
accessorKey: 'type.name',
- header: ({ column }) => ,
+ header: ({ column }) => ,
enableSorting: false,
enableHiding: false,
meta: {
diff --git a/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx b/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx
index 5e28d8f..273dd4f 100644
--- a/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx
+++ b/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx
@@ -157,7 +157,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => {
},
{
accessorKey: 'type.name',
- header: ({ column }) => ,
+ header: ({ column }) => ,
enableSorting: false,
enableHiding: false,
meta: {
diff --git a/src/pages/transfer/transfertype/blocks/AddDialog.tsx b/src/pages/transfer/transfertype/blocks/AddDialog.tsx
index ed5576f..19760af 100644
--- a/src/pages/transfer/transfertype/blocks/AddDialog.tsx
+++ b/src/pages/transfer/transfertype/blocks/AddDialog.tsx
@@ -218,7 +218,7 @@ const AddDialog = () => {
order_direction: 'ASC',
};
const response = await GetData(`${API_URL_MASTERDATA}/wallet/list`, params);
- console.log(response)
+ // console.log(response)
if (response?.status && response?.data) {
setWallets(response.data.list);
} else {
@@ -230,7 +230,7 @@ const AddDialog = () => {
if (!showAddDialog) return;
fetchWallets();
}, [showAddDialog]);
-
+ // console.log(formField)
return (