real_box update
This commit is contained in:
@@ -8,12 +8,8 @@ import { ChangeEvent, useState } from 'react';
|
||||
const useInput = (initialValue: string) => {
|
||||
const [value, setValue] = useState(initialValue);
|
||||
|
||||
const handleChange = (event: ChangeEvent<HTMLInputElement> | string) => {
|
||||
if (typeof event === 'string') {
|
||||
setValue(event);
|
||||
} else if (event?.target) {
|
||||
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(event.target.value);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -49,7 +49,7 @@ interface Props {
|
||||
const DashboardCreateRealBoxPage = ({ initialValues, partiesData }: Props) => {
|
||||
const { user, isAdmin: isAdminUser } = useAuthContext();
|
||||
const editMode = !!initialValues?.id;
|
||||
const { value: keyword, onChange: handleKeyword, setValue: setKeyword } = useInput('');
|
||||
const [keyword, handleKeyword] = useState('');
|
||||
const t = useMyTranslation();
|
||||
const params = useSearchParams();
|
||||
const { push } = useMyNavigation();
|
||||
|
||||
@@ -54,7 +54,7 @@ const DashboardRealBoxesPage = (props: Props) => {
|
||||
() =>
|
||||
real_box_requests.getAll({
|
||||
page: page,
|
||||
cargoId: keyword,
|
||||
boxName: keyword,
|
||||
status: boxStatusFilter,
|
||||
direction: 'desc',
|
||||
sort: 'id',
|
||||
|
||||
Reference in New Issue
Block a user