From 3b4a6b578a430eb9c6bc1164920ecd4fea254e30 Mon Sep 17 00:00:00 2001 From: lev tarasov <56757711+levil664@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:30:52 +0500 Subject: [PATCH 1/4] remove pagination --- .../circle/components/circleList/index.tsx | 19 ------- .../components/employeeList/index.tsx | 21 ------- .../organization/redux/organizationApi.ts | 8 +-- .../query/components/queryList/index.tsx | 19 ------- .../components/currentStudent/index.tsx | 3 +- .../student/components/studentList/index.tsx | 55 +------------------ .../components/studentList/interfaces.ts | 2 +- .../ticket/components/ticketList/index.tsx | 19 ------- 8 files changed, 9 insertions(+), 137 deletions(-) diff --git a/apps/schools/domains/circle/components/circleList/index.tsx b/apps/schools/domains/circle/components/circleList/index.tsx index 9c23ba0d..1daad16b 100644 --- a/apps/schools/domains/circle/components/circleList/index.tsx +++ b/apps/schools/domains/circle/components/circleList/index.tsx @@ -20,16 +20,9 @@ export function CircleList() { const [searchRequestText, setSearchRequestText] = useState('') const { organizationId } = useOrganization() - const [paginationParams, setPaginationParams] = useState({ - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, - }) - const { data: circles, isFetching: isFetching } = useGetAllCirclesQuery({ organization_id: organizationId, or_search: createSearchTextForRequest(searchRequestText, searchStudentsColumns), - page: paginationParams.page, - page_size: paginationParams.pageSize, }) return ( @@ -60,18 +53,6 @@ export function CircleList() { ['Адрес', 'address'], ['Кол-во принятых заявок', 'accepted_count'], ]} - pagination={{ - current: paginationParams.page, - pageSize: paginationParams.pageSize, - total: circles?.count, - onChange: (page, pageSize) => { - setPaginationParams({ - page, - pageSize, - }) - scrollToTop() - }, - }} data={circles} isLoading={isFetching} mainRoute={RoutePath[AppRoutes.CIRCLE_LIST]} diff --git a/apps/schools/domains/employee/components/employeeList/index.tsx b/apps/schools/domains/employee/components/employeeList/index.tsx index 7247578b..f804b134 100644 --- a/apps/schools/domains/employee/components/employeeList/index.tsx +++ b/apps/schools/domains/employee/components/employeeList/index.tsx @@ -11,23 +11,14 @@ import { GetListEmployee } from '@domains/employee/redux/interfaces' import { RowType } from '@domains/employee/components/employeeList/interfaces' import { searchColumns } from '@domains/employee/components/employeeList/constants' import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums' -import { defaultPaginationTablePage, defaultPaginationTablePageSize } from '@domains/common/constants/Table' -import { scrollToTop } from '@domains/common/utils/scrollInDirection' export function EmployeeList() { const [searchRequestText, setSearchRequestText] = useState('') const { organizationId } = useOrganization() - const [paginationParams, setPaginationParams] = useState({ - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, - }) - const { data, isFetching } = useGetAllEmployeesQuery({ organization: organizationId, or_search: createSearchTextForRequest(searchRequestText, searchColumns), - page: paginationParams.page, - page_size: paginationParams.pageSize, }) return ( @@ -50,18 +41,6 @@ export function EmployeeList() { ['Должность', 'position'], ['Телефон', 'phone'], ]} - pagination={{ - current: paginationParams.page, - pageSize: paginationParams.pageSize, - total: data?.count, - onChange: (page, pageSize) => { - setPaginationParams({ - page, - pageSize, - }) - scrollToTop() - }, - }} data={data} isLoading={isFetching} mainRoute={RoutePath[AppRoutes.EMPLOYEE_LIST]} diff --git a/apps/schools/domains/organization/redux/organizationApi.ts b/apps/schools/domains/organization/redux/organizationApi.ts index 2307d8a5..bd63a421 100644 --- a/apps/schools/domains/organization/redux/organizationApi.ts +++ b/apps/schools/domains/organization/redux/organizationApi.ts @@ -65,7 +65,7 @@ const organizationApi = commonApi.injectEndpoints({ body: data, }), }), - getAllStudents: build.query, AllStudentsData>({ + getAllStudents: build.query, AllStudentsData>({ query: (params) => ({ url: '/organization-management/organizations/students', method: 'GET', @@ -73,7 +73,7 @@ const organizationApi = commonApi.injectEndpoints({ }), transformResponse: (response: ReturnedData) => { return mapReturnedData(response, (query) => { - const transformedQuery = structuredClone(query) as unknown as TableTypeStudent + const transformedQuery = structuredClone(query) transformedQuery.id = query.id transformedQuery.student_name = query.name transformedQuery.student_phone = query.student_profile.phone @@ -182,8 +182,8 @@ const organizationApi = commonApi.injectEndpoints({ }), transformResponse: (response: ReturnedData) => { return mapReturnedData(response, (query) => { - const transformedQuery = structuredClone(query) as unknown as TableTypeStudent - transformedQuery.id = query.body.id + const transformedQuery = structuredClone(query) + transformedQuery.id = query.body.id || '' transformedQuery.student_name = query.body.name transformedQuery.student_phone = query.additional.phone transformedQuery.parent_phone = query.recipient.parent_phones.replaceAll(',', '\n') diff --git a/apps/schools/domains/query/components/queryList/index.tsx b/apps/schools/domains/query/components/queryList/index.tsx index e8153aff..cb0a8ad6 100644 --- a/apps/schools/domains/query/components/queryList/index.tsx +++ b/apps/schools/domains/query/components/queryList/index.tsx @@ -70,16 +70,9 @@ export function QueryList() { return items }, [analytics, statuses]) - const [paginationParams, setPaginationParams] = useState({ - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, - }) - const { data: queries, isFetching: isQueriesFetching } = useGetAllJoinCircleQueriesQuery({ circle__organization__id: organizationId, or_search: createSearchTextForRequest(searchRequestText, searchStudentsColumns), - page: paginationParams.page, - page_size: paginationParams.pageSize, }) const countAllQueries = useMemo( @@ -129,18 +122,6 @@ export function QueryList() { ['Телефон родителя', 'parent_phone'], ['Кружок', 'circle_name'], ]} - pagination={{ - current: paginationParams.page, - pageSize: paginationParams.pageSize, - total: queries?.count, - onChange: (page, pageSize) => { - setPaginationParams({ - page, - pageSize, - }) - scrollToTop() - }, - }} data={queries} isLoading={isQueriesFetching} mainRoute={RoutePath[AppRoutes.QUERY_LIST]} diff --git a/apps/schools/domains/student/components/currentStudent/index.tsx b/apps/schools/domains/student/components/currentStudent/index.tsx index 63640f14..adb5121c 100644 --- a/apps/schools/domains/student/components/currentStudent/index.tsx +++ b/apps/schools/domains/student/components/currentStudent/index.tsx @@ -15,11 +15,12 @@ import { Field } from '@domains/common/components/field' import { useDeleteStudentMutation } from '@domains/student/redux/studentApi' import { ActionBar } from '@domains/common/components/stickyBlock/actionBar' import DeleteModal from '@domains/common/components/deleteModal' -import { GetStudent } from '@domains/common/redux/serializers' +import { GetCircleInviteStudent, GetStudent } from '@domains/common/redux/serializers' import { useOrganization } from '@domains/organization/providers/organizationProvider' import parentAcceptedPhone from '@public/icons/parentAcceptedMobile.svg' import parentDeclinedPhone from '@public/icons/parentDeclinedMobile.svg' import { AppRoutes, DynamicAppRoutes, DynamicRoutePath, RoutePath } from '@domains/common/constants/routerEnums' +import { ReturnedData } from '@domains/common/redux/interfaces' const CurrentStudent = () => { const [isModalVisible, setIsModalVisible] = useState(false) diff --git a/apps/schools/domains/student/components/studentList/index.tsx b/apps/schools/domains/student/components/studentList/index.tsx index f035c9a2..32d1e10d 100644 --- a/apps/schools/domains/student/components/studentList/index.tsx +++ b/apps/schools/domains/student/components/studentList/index.tsx @@ -17,19 +17,9 @@ import { scrollToTop } from '@domains/common/utils/scrollInDirection' import { handlePaginationChange } from '@domains/common/handlers/paginationChange' import { calculateResults } from '@domains/student/handlers/resultsCalculate' import { getTotalPages } from '@domains/common/utils/getTotalPages' +import { ReturnedData } from '@domains/common/redux/interfaces' export function StudentList() { - const [queryPaginationParams, setQueryPaginationParams] = useState({ - invites: { - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, - }, - students: { - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, - }, - }) - const [searchRequestText, setSearchRequestText] = useState('') const { organizationId } = useOrganization() @@ -37,48 +27,18 @@ export function StudentList() { circle__organization__id: organizationId, status: StatusesEnum.SENT, or_search: createSearchTextForRequest(searchRequestText, searchInvitesColumns), - page: queryPaginationParams.invites.page, - page_size: queryPaginationParams.invites.pageSize, }) const { data: students, isFetching: isFetchingStudents } = useGetAllStudentsQuery({ circle__organization: organizationId, or_search: createSearchTextForRequest(searchRequestText, searchStudentsColumns), - page: queryPaginationParams.students.page, - page_size: queryPaginationParams.students.pageSize, - }) - - const [paginationParams, setPaginationParams] = useState({ - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, }) - const resultsCalculate = useCallback( - () => calculateResults(paginationParams, { invites, students }), - [paginationParams, invites, students], - ) - const data = { count: (invites?.count ?? 0) + (students?.count ?? 0), next: invites?.next ?? '', previous: invites?.previous ?? '', - results: resultsCalculate(), - } - - const handlePageChange = (newPage: number, newPageSize: number) => { - handlePaginationChange( - setPaginationParams, - setQueryPaginationParams as any, - { - invites: invites?.count, - students: students?.count, - }, - newPage, - newPageSize, - defaultPaginationTablePage, - defaultPaginationTablePageSize, - scrollToTop, - ) + results: [...((invites?.results ?? []) as unknown as TableType[]), ...(students?.results ?? [])], } return ( @@ -111,17 +71,6 @@ export function StudentList() { ['Телефон обучающегося', 'student_phone'], ['Телефон родителя', 'parent_phone'], ]} - pagination={{ - current: paginationParams.page, - pageSize: paginationParams.pageSize, - total: getTotalPages( - { invites: { count: invites?.count }, students: { count: students?.count } }, - paginationParams.pageSize, - ), - onChange: (page, pageSize) => { - handlePageChange(page, pageSize) - }, - }} filterFields={['circle_name']} data={data} isLoading={isLoadingInvites || isFetchingStudents} diff --git a/apps/schools/domains/student/components/studentList/interfaces.ts b/apps/schools/domains/student/components/studentList/interfaces.ts index 36c22cb9..0ba393b7 100644 --- a/apps/schools/domains/student/components/studentList/interfaces.ts +++ b/apps/schools/domains/student/components/studentList/interfaces.ts @@ -7,7 +7,7 @@ export interface RowType { } export interface TableType { - id?: string + id: string student_name: string student_phone: string parent_phone: string diff --git a/apps/schools/domains/ticket/components/ticketList/index.tsx b/apps/schools/domains/ticket/components/ticketList/index.tsx index c8fbfc49..319a9099 100644 --- a/apps/schools/domains/ticket/components/ticketList/index.tsx +++ b/apps/schools/domains/ticket/components/ticketList/index.tsx @@ -70,16 +70,9 @@ export function TicketList() { } as BubbleFilterListItem } - const [paginationParams, setPaginationParams] = useState({ - page: defaultPaginationTablePage, - pageSize: defaultPaginationTablePageSize, - }) - const { data: tickets, isFetching: isTicketsFetching } = useGetAllTicketsQuery({ organization_id: organizationId, or_search: createSearchTextForRequest(searchRequestText, searchTicketsColumns), - page: paginationParams.page, - page_size: paginationParams.pageSize, }) useEffect(() => { @@ -132,18 +125,6 @@ export function TicketList() {
loading={isTableLoading} - pagination={{ - current: paginationParams.page, - pageSize: paginationParams.pageSize, - total: tickets?.count, - onChange: (page, pageSize) => { - setPaginationParams({ - page, - pageSize, - }) - scrollToTop() - }, - }} customType={'tableWithoutSearch'} columnsTitlesAndKeys={[ ['Создано', 'created_at'], From 148bf242e915a0d34f6806c27bc65abe754d061a Mon Sep 17 00:00:00 2001 From: lev tarasov <56757711+levil664@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:31:18 +0500 Subject: [PATCH 2/4] prettier --- .../user/components/profile/profileEdit/index.tsx | 4 ++-- .../user/components/profile/profileInfo/index.tsx | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/schools/domains/user/components/profile/profileEdit/index.tsx b/apps/schools/domains/user/components/profile/profileEdit/index.tsx index bfb1756e..7ccfc3da 100644 --- a/apps/schools/domains/user/components/profile/profileEdit/index.tsx +++ b/apps/schools/domains/user/components/profile/profileEdit/index.tsx @@ -63,7 +63,7 @@ export function ProfileEdit() { required={true} label={ - * Ф.И.О. + * Ф.И.О. } name={USER_NAME} @@ -78,7 +78,7 @@ export function ProfileEdit() { required={true} label={ - * Email сотрудника + * Email сотрудника } name={USER_EMAIL} diff --git a/apps/schools/domains/user/components/profile/profileInfo/index.tsx b/apps/schools/domains/user/components/profile/profileInfo/index.tsx index 78e0a7b7..1c8f00ab 100644 --- a/apps/schools/domains/user/components/profile/profileInfo/index.tsx +++ b/apps/schools/domains/user/components/profile/profileInfo/index.tsx @@ -40,11 +40,7 @@ export function ProfileInfo() { ) : ( results.data?.results.map((employee) => (
- + router.push(RoutePath[AppRoutes.USER_EDIT])}> + From ac6bb70b07a73ade01bbfc6d298ad62fa8b5f8fe Mon Sep 17 00:00:00 2001 From: lev tarasov <56757711+levil664@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:35:30 +0500 Subject: [PATCH 3/4] fix warnings --- .../domains/circle/components/circleList/index.tsx | 2 -- apps/schools/domains/query/components/queryList/index.tsx | 2 -- .../domains/student/components/currentStudent/index.tsx | 3 +-- .../domains/student/components/studentList/index.tsx | 8 +------- .../domains/ticket/components/ticketList/index.tsx | 2 -- 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/apps/schools/domains/circle/components/circleList/index.tsx b/apps/schools/domains/circle/components/circleList/index.tsx index 1daad16b..f87fe06b 100644 --- a/apps/schools/domains/circle/components/circleList/index.tsx +++ b/apps/schools/domains/circle/components/circleList/index.tsx @@ -13,8 +13,6 @@ import EmptyWrapper from '@domains/common/components/containers/EmptyWrapper' import { HighlightText } from '@domains/common/components/table/forming' import { getVarsForAddressColumn } from '@domains/common/utils/geo' import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums' -import { defaultPaginationTablePage, defaultPaginationTablePageSize } from '@domains/common/constants/Table' -import { scrollToTop } from '@domains/common/utils/scrollInDirection' export function CircleList() { const [searchRequestText, setSearchRequestText] = useState('') diff --git a/apps/schools/domains/query/components/queryList/index.tsx b/apps/schools/domains/query/components/queryList/index.tsx index cb0a8ad6..87f3016c 100644 --- a/apps/schools/domains/query/components/queryList/index.tsx +++ b/apps/schools/domains/query/components/queryList/index.tsx @@ -20,8 +20,6 @@ import { useQueryState } from 'next-usequerystate' import { parseAsArrayOf, parseAsString } from 'next-usequerystate' import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums' import SearchInput from '@domains/common/components/searchInput' -import { defaultPaginationTablePage, defaultPaginationTablePageSize } from '@domains/common/constants/Table' -import { scrollToTop } from '@domains/common/utils/scrollInDirection' export function QueryList() { const { organizationId } = useOrganization() diff --git a/apps/schools/domains/student/components/currentStudent/index.tsx b/apps/schools/domains/student/components/currentStudent/index.tsx index adb5121c..63640f14 100644 --- a/apps/schools/domains/student/components/currentStudent/index.tsx +++ b/apps/schools/domains/student/components/currentStudent/index.tsx @@ -15,12 +15,11 @@ import { Field } from '@domains/common/components/field' import { useDeleteStudentMutation } from '@domains/student/redux/studentApi' import { ActionBar } from '@domains/common/components/stickyBlock/actionBar' import DeleteModal from '@domains/common/components/deleteModal' -import { GetCircleInviteStudent, GetStudent } from '@domains/common/redux/serializers' +import { GetStudent } from '@domains/common/redux/serializers' import { useOrganization } from '@domains/organization/providers/organizationProvider' import parentAcceptedPhone from '@public/icons/parentAcceptedMobile.svg' import parentDeclinedPhone from '@public/icons/parentDeclinedMobile.svg' import { AppRoutes, DynamicAppRoutes, DynamicRoutePath, RoutePath } from '@domains/common/constants/routerEnums' -import { ReturnedData } from '@domains/common/redux/interfaces' const CurrentStudent = () => { const [isModalVisible, setIsModalVisible] = useState(false) diff --git a/apps/schools/domains/student/components/studentList/index.tsx b/apps/schools/domains/student/components/studentList/index.tsx index 32d1e10d..ee1e9543 100644 --- a/apps/schools/domains/student/components/studentList/index.tsx +++ b/apps/schools/domains/student/components/studentList/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from 'react' +import React, { useState } from 'react' import { Typography } from 'antd' import router from 'next/router' import styles from './styles/styles.module.scss' @@ -12,12 +12,6 @@ import { useGetAllStudentInvitationsQuery, useGetAllStudentsQuery } from '@domai import { StatusesEnum } from '@domains/common/constants/Enums' import EmptyWrapper from '@domains/common/components/containers/EmptyWrapper' import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums' -import { defaultPaginationTablePage, defaultPaginationTablePageSize } from '@domains/common/constants/Table' -import { scrollToTop } from '@domains/common/utils/scrollInDirection' -import { handlePaginationChange } from '@domains/common/handlers/paginationChange' -import { calculateResults } from '@domains/student/handlers/resultsCalculate' -import { getTotalPages } from '@domains/common/utils/getTotalPages' -import { ReturnedData } from '@domains/common/redux/interfaces' export function StudentList() { const [searchRequestText, setSearchRequestText] = useState('') diff --git a/apps/schools/domains/ticket/components/ticketList/index.tsx b/apps/schools/domains/ticket/components/ticketList/index.tsx index 319a9099..3f3c6b8e 100644 --- a/apps/schools/domains/ticket/components/ticketList/index.tsx +++ b/apps/schools/domains/ticket/components/ticketList/index.tsx @@ -19,8 +19,6 @@ import Image from 'next/image' import dot from '@public/icons/dot.svg' import SearchInput from '@domains/common/components/searchInput' import { FilterValue, SorterResult, TableCurrentDataSource } from 'antd/es/table/interface' -import { defaultPaginationTablePage, defaultPaginationTablePageSize } from '@domains/common/constants/Table' -import { scrollToTop } from '@domains/common/utils/scrollInDirection' type HandleInputChange = (text: React.ChangeEvent | string) => void type HandleChange = ( From 74750c84328760e80a0133817fff4c74b580a744 Mon Sep 17 00:00:00 2001 From: lev tarasov <56757711+levil664@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:26:38 +0500 Subject: [PATCH 4/4] prettier --- .../domains/circle/components/circleList/index.tsx | 6 +++--- .../domains/circle/components/currentCircle/index.tsx | 2 +- apps/schools/domains/common/components/table/index.tsx | 2 +- .../schools/domains/common/components/table/interfaces.ts | 2 +- .../domains/employee/components/employeeList/index.tsx | 4 ++-- apps/schools/domains/query/components/queryList/index.tsx | 2 +- .../domains/student/components/studentList/index.tsx | 4 ++-- .../domains/ticket/components/ticketList/index.tsx | 8 ++++---- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/schools/domains/circle/components/circleList/index.tsx b/apps/schools/domains/circle/components/circleList/index.tsx index 8a9d24e7..72321657 100644 --- a/apps/schools/domains/circle/components/circleList/index.tsx +++ b/apps/schools/domains/circle/components/circleList/index.tsx @@ -13,15 +13,15 @@ import EmptyWrapper from '@domains/common/components/containers/EmptyWrapper' import { HighlightText } from '@domains/common/components/table/forming' import { getVarsForAddressColumn } from '@domains/common/utils/geo' import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums' -import { useQueryState } from "next-usequerystate"; +import { useQueryState } from 'next-usequerystate' export function CircleList() { const [searchRequestText, setSearchRequestText] = useQueryState('search') const { organizationId } = useOrganization() const { data: circles, isFetching: isFetching } = useGetAllCirclesQuery({ - organization_id: organizationId, - or_search: createSearchTextForRequest(searchRequestText || '', searchStudentsColumns), + organization_id: organizationId, + or_search: createSearchTextForRequest(searchRequestText || '', searchStudentsColumns), }) return ( diff --git a/apps/schools/domains/circle/components/currentCircle/index.tsx b/apps/schools/domains/circle/components/currentCircle/index.tsx index bb89ebfd..dd0398c2 100644 --- a/apps/schools/domains/circle/components/currentCircle/index.tsx +++ b/apps/schools/domains/circle/components/currentCircle/index.tsx @@ -25,7 +25,7 @@ import { getVarsForAddressColumn } from '@domains/common/utils/geo' import { StatusesEnum } from '@domains/common/constants/Enums' import { ErrorType } from '@store/commonApi' import { AppRoutes, DynamicAppRoutes, DynamicRoutePath, RoutePath } from '@domains/common/constants/routerEnums' -import {useQueryState} from "next-usequerystate"; +import { useQueryState } from 'next-usequerystate' const CurrentCircle = () => { const [isModalVisible, setIsModalVisible] = useState(false) diff --git a/apps/schools/domains/common/components/table/index.tsx b/apps/schools/domains/common/components/table/index.tsx index 108f962e..f01e598b 100644 --- a/apps/schools/domains/common/components/table/index.tsx +++ b/apps/schools/domains/common/components/table/index.tsx @@ -9,7 +9,7 @@ import { typeTable } from '@domains/common/constants/Table' import { CustomTableProps } from '@domains/common/components/table/interfaces' import { calculateAverageWidth } from '@domains/common/utils/calculateAverageWidth' import { ColumnType } from 'antd/lib/table/interface' -import { useQueryState } from "next-usequerystate"; +import { useQueryState } from 'next-usequerystate' export const Table = (props: CustomTableProps) => { const { diff --git a/apps/schools/domains/common/components/table/interfaces.ts b/apps/schools/domains/common/components/table/interfaces.ts index 332235ab..54ba112b 100644 --- a/apps/schools/domains/common/components/table/interfaces.ts +++ b/apps/schools/domains/common/components/table/interfaces.ts @@ -3,7 +3,7 @@ import { ReturnedData } from '@domains/common/redux/interfaces' import { TableProps } from 'antd' import { ColumnFilterItem } from 'antd/lib/table/interface' import { Key } from 'antd/es/table/interface' -import {Options} from "next-usequerystate"; +import { Options } from 'next-usequerystate' export interface CustomFieldsProps { [key: string]: React.FC<{ diff --git a/apps/schools/domains/employee/components/employeeList/index.tsx b/apps/schools/domains/employee/components/employeeList/index.tsx index 43c0c900..5024dec1 100644 --- a/apps/schools/domains/employee/components/employeeList/index.tsx +++ b/apps/schools/domains/employee/components/employeeList/index.tsx @@ -15,12 +15,12 @@ import { useQueryState } from 'next-usequerystate' import { scrollToTop } from '@domains/common/utils/scrollInDirection' export function EmployeeList() { - const [searchRequest, setSearchRequest] = useQueryState('search') + const [searchRequest, setSearchRequest] = useQueryState('search') const { organizationId } = useOrganization() const { data, isFetching } = useGetAllEmployeesQuery({ organization: organizationId, - or_search: createSearchTextForRequest(searchRequest || '', searchColumns), + or_search: createSearchTextForRequest(searchRequest || '', searchColumns), }) return ( diff --git a/apps/schools/domains/query/components/queryList/index.tsx b/apps/schools/domains/query/components/queryList/index.tsx index 5f82f32d..61be9087 100644 --- a/apps/schools/domains/query/components/queryList/index.tsx +++ b/apps/schools/domains/query/components/queryList/index.tsx @@ -70,7 +70,7 @@ export function QueryList() { const { data: queries, isFetching: isQueriesFetching } = useGetAllJoinCircleQueriesQuery({ circle__organization__id: organizationId, - or_search: createSearchTextForRequest(searchRequest || '', searchStudentsColumns) + or_search: createSearchTextForRequest(searchRequest || '', searchStudentsColumns), }) const countAllQueries = useMemo( diff --git a/apps/schools/domains/student/components/studentList/index.tsx b/apps/schools/domains/student/components/studentList/index.tsx index fa14028f..e64a9ac1 100644 --- a/apps/schools/domains/student/components/studentList/index.tsx +++ b/apps/schools/domains/student/components/studentList/index.tsx @@ -17,10 +17,10 @@ import { scrollToTop } from '@domains/common/utils/scrollInDirection' import { handlePaginationChange } from '@domains/common/handlers/paginationChange' import { calculateResults } from '@domains/student/handlers/resultsCalculate' import { getTotalPages } from '@domains/common/utils/getTotalPages' -import { useQueryState } from "next-usequerystate" +import { useQueryState } from 'next-usequerystate' export function StudentList() { - const [searchRequestText, setSearchRequestText] = useQueryState('search') + const [searchRequestText, setSearchRequestText] = useQueryState('search') const { organizationId } = useOrganization() const { data: invites, isLoading: isLoadingInvites } = useGetAllStudentInvitationsQuery({ diff --git a/apps/schools/domains/ticket/components/ticketList/index.tsx b/apps/schools/domains/ticket/components/ticketList/index.tsx index 3f12e7b7..595f0cd7 100644 --- a/apps/schools/domains/ticket/components/ticketList/index.tsx +++ b/apps/schools/domains/ticket/components/ticketList/index.tsx @@ -29,10 +29,10 @@ type HandleChange = ( ) => void export function TicketList() { - const [inputText, setInputText] = useState('') - const [isTableLoading, setIsTableLoading] = useState(false) - const { organizationId } = useOrganization() - const [searchRequest, setSearchRequest] = useQueryState('search') + const [inputText, setInputText] = useState('') + const [isTableLoading, setIsTableLoading] = useState(false) + const { organizationId } = useOrganization() + const [searchRequest, setSearchRequest] = useQueryState('search') const [statuses, setStatuses] = useQueryState( 'statuses',