removed unused code
This commit is contained in:
parent
5fea95f006
commit
6adad5718a
@ -27,7 +27,7 @@ export const useAdvancePaymentContext = () => {
|
||||
};
|
||||
const AdvancePaymentPage = () => {
|
||||
const [balance, setBalance] = useState(null);
|
||||
const { reset, watch } = useForm({
|
||||
const {control, reset, watch } = useForm({
|
||||
defaultValues: {
|
||||
employeeId: "",
|
||||
},
|
||||
@ -40,15 +40,7 @@ const AdvancePaymentPage = () => {
|
||||
employeeId: selectedEmpoyee || "",
|
||||
});
|
||||
}, [reset]);
|
||||
const { control, handleSubmit } = useForm({
|
||||
defaultValues: {
|
||||
selectedUsers: ["08ddb487-9c34-4295-857b-7017549c4d8c"], // works on update
|
||||
},
|
||||
});
|
||||
|
||||
const onSubmit = (data) => {
|
||||
console.log("Selected User IDs:", data.selectedUsers);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<AdvancePaymentContext.Provider value={{ setBalance }}>
|
||||
@ -95,20 +87,7 @@ const AdvancePaymentPage = () => {
|
||||
</div>
|
||||
<AdvancePaymentList employeeId={selectedEmployeeId} />
|
||||
|
||||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
<div className="col-6">
|
||||
<label className="form-label fw-semibold">Assign Users</label>
|
||||
<UsersTagInput
|
||||
control={control}
|
||||
name="selectedUsers"
|
||||
placeholder="Type to search users"
|
||||
forAll={true}
|
||||
/>
|
||||
</div>
|
||||
<button type="submit" className="btn btn-primary mt-3">
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</AdvancePaymentContext.Provider>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user