real_box update

This commit is contained in:
Samandar Turg'unboev
2025-05-29 12:54:30 +05:00
parent b96e7403d0
commit 26fdc3c67a
3 changed files with 4 additions and 8 deletions

View File

@@ -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) {
setValue(event.target.value);
}
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
setValue(event.target.value);
};
return {

View File

@@ -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();

View File

@@ -54,7 +54,7 @@ const DashboardRealBoxesPage = (props: Props) => {
() =>
real_box_requests.getAll({
page: page,
cargoId: keyword,
boxName: keyword,
status: boxStatusFilter,
direction: 'desc',
sort: 'id',