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