From dfb61ef1442e70550fd3e7cdae69b64f51d1a430 Mon Sep 17 00:00:00 2001 From: Samandar Turg'unboev Date: Mon, 16 Jun 2025 09:55:49 +0500 Subject: [PATCH] filter --- src/data/customers/customer.requests.ts | 2 +- .../private/boxes/DashboardBoxesPage.tsx | 25 +++++++++---------- .../private/clients/DashboardClientsPage.tsx | 17 ++++++------- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/data/customers/customer.requests.ts b/src/data/customers/customer.requests.ts index 06481dc..c622a58 100644 --- a/src/data/customers/customer.requests.ts +++ b/src/data/customers/customer.requests.ts @@ -5,7 +5,7 @@ import omit from 'lodash.omit'; export const customer_requests = { async getAll(params?: { - cargoId?: string; + clientName?: string; aviaCargoId?: string; autoCargoId?: string; page?: number; diff --git a/src/routes/private/boxes/DashboardBoxesPage.tsx b/src/routes/private/boxes/DashboardBoxesPage.tsx index ad35b65..b2856f4 100644 --- a/src/routes/private/boxes/DashboardBoxesPage.tsx +++ b/src/routes/private/boxes/DashboardBoxesPage.tsx @@ -1,28 +1,25 @@ 'use client'; import ActionPopMenu from '@/components/common/ActionPopMenu'; -import { MyTable, ColumnData } from '@/components/common/MyTable'; +import { ColumnData, MyTable } from '@/components/common/MyTable'; import StatusChangePopup from '@/components/common/StatusChangePopup'; import BaseButton from '@/components/ui-kit/BaseButton'; -import BaseIconButton from '@/components/ui-kit/BaseIconButton'; import BaseInput from '@/components/ui-kit/BaseInput'; import BasePagination from '@/components/ui-kit/BasePagination'; import { useAuthContext } from '@/context/auth-context'; import { BoxStatus, BoxStatusList, IBox } from '@/data/box/box.model'; import { box_requests } from '@/data/box/box.requests'; import { DEFAULT_PAGE_SIZE, pageLinks } from '@/helpers/constants'; -import useDebouncedInput from '@/hooks/useDebouncedInput'; import useInput from '@/hooks/useInput'; import { useMyNavigation } from '@/hooks/useMyNavigation'; import { useMyTranslation } from '@/hooks/useMyTranslation'; import useRequest from '@/hooks/useRequest'; import { file_service } from '@/services/file-service'; import { notifyUnknownError } from '@/services/notification'; -import { getBoxStatusStyles, getStatusColor } from '@/theme/getStatusBoxStyles'; -import { Add, AddCircleOutline, Circle, Delete, Download, Edit, FilterList, FilterListOff, Search, PlusOne } from '@mui/icons-material'; -import { Box, Button, Stack, Tooltip, Typography } from '@mui/material'; -import { useRouter } from 'next/navigation'; -import React, { useEffect, useMemo, useState } from 'react'; +import { getStatusColor } from '@/theme/getStatusBoxStyles'; +import { Add, Circle, Delete, Download, Edit, FilterList, FilterListOff, Search } from '@mui/icons-material'; +import { Box, Button, Stack, Typography } from '@mui/material'; +import { useEffect, useMemo, useState } from 'react'; type Props = {}; @@ -162,9 +159,11 @@ const DashboardBoxesPage = (props: Props) => { label: "Qo'shish", width: 120, renderCell: data => { - return ; + return ( + + ); }, }, { @@ -179,7 +178,7 @@ const DashboardBoxesPage = (props: Props) => { }, { dataKey: 'packetNetWeight', - label: t("weight"), + label: t('weight'), width: 120, }, { @@ -189,7 +188,7 @@ const DashboardBoxesPage = (props: Props) => { }, { dataKey: 'totalNetWeight', - label: t("party_weight"), + label: t('party_weight'), width: 120, }, { diff --git a/src/routes/private/clients/DashboardClientsPage.tsx b/src/routes/private/clients/DashboardClientsPage.tsx index 9230ebb..badc0df 100644 --- a/src/routes/private/clients/DashboardClientsPage.tsx +++ b/src/routes/private/clients/DashboardClientsPage.tsx @@ -1,17 +1,14 @@ 'use client'; import ActionPopMenu from '@/components/common/ActionPopMenu'; -import { MyTable, ColumnData } from '@/components/common/MyTable'; +import { ColumnData, MyTable } from '@/components/common/MyTable'; import BaseButton from '@/components/ui-kit/BaseButton'; -import BaseIconButton from '@/components/ui-kit/BaseIconButton'; import BaseInput from '@/components/ui-kit/BaseInput'; import BasePagination from '@/components/ui-kit/BasePagination'; import { useAuthContext } from '@/context/auth-context'; import { Customer } from '@/data/customers/customer.model'; import { customer_requests } from '@/data/customers/customer.requests'; -import { Party } from '@/data/party/party.model'; -import { party_requests } from '@/data/party/party.requests'; -import { DEFAULT_PAGE_SIZE, pageLinks } from '@/helpers/constants'; +import { DEFAULT_PAGE_SIZE } from '@/helpers/constants'; import useInput from '@/hooks/useInput'; import { useMyTranslation } from '@/hooks/useMyTranslation'; import useRequest from '@/hooks/useRequest'; @@ -20,9 +17,9 @@ import CreateClientModal from '@/routes/private/clients/CreateClientModal'; import EditClientModal from '@/routes/private/clients/EditClientModal'; import { file_service } from '@/services/file-service'; import { notifyUnknownError } from '@/services/notification'; -import { Add, AddCircleOutline, Circle, Delete, Edit, FilterList, FilterListOff, Search } from '@mui/icons-material'; -import { Box, Stack, SvgIcon, Tooltip, Typography } from '@mui/material'; -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { Add, Delete, Edit, FilterListOff, Search } from '@mui/icons-material'; +import { Box, Stack, Typography } from '@mui/material'; +import { useCallback, useEffect, useMemo, useState } from 'react'; type Props = {}; @@ -45,7 +42,7 @@ const DashboardClientsPage = (props: Props) => { () => customer_requests.getAll({ page: page, - cargoId: keyword, + clientName: keyword, }), { selectData(data) { @@ -341,7 +338,7 @@ const DashboardClientsPage = (props: Props) => { }} value={keyword} onChange={handleKeyword} - placeholder={"Kargo ID"} + placeholder={'Kargo ID'} /> } size='small' onClick={resetFilter}>