From ce539c4f3519a6eda9dbc991a4e428bbf8c62688 Mon Sep 17 00:00:00 2001 From: Grog Date: Tue, 27 Oct 2026 17:22:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=84=D0=B8=D0=BA=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B1=D0=B0=D0=B3=D0=B8=20=D1=84=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D0=B0=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/services/api/directories/company_groups.ts | 2 +- web/src/store/slices/companyGroupsSlice/thunks.ts | 6 +++--- .../widgets/CatalogueGroupHeader/CatalogueGroupHeader.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/services/api/directories/company_groups.ts b/web/src/services/api/directories/company_groups.ts index de847e3..5ac3cdc 100644 --- a/web/src/services/api/directories/company_groups.ts +++ b/web/src/services/api/directories/company_groups.ts @@ -10,7 +10,7 @@ export const LE_PAGE = 200; export async function fetchCompanyGroups(params: GetCompanyGroupsPropsI): Promise { const all: ICompanyGroupOut[] = []; for (let offset = 0; ; offset += CG_PAGE) { - const page = await api.get>(`/directories/company-groups`, { + const page = await api.get>('/directories/company-groups', { limit: CG_PAGE, offset: offset, ...params, diff --git a/web/src/store/slices/companyGroupsSlice/thunks.ts b/web/src/store/slices/companyGroupsSlice/thunks.ts index ff8779b..98cbefa 100644 --- a/web/src/store/slices/companyGroupsSlice/thunks.ts +++ b/web/src/store/slices/companyGroupsSlice/thunks.ts @@ -5,11 +5,11 @@ import type { GetCompanyGroupsPropsI } from './types'; export const getCompanyGroupsThunk = createAsyncThunk( 'company_groups/getAll', - async (args = {}, thunkApi) => { + async (args, thunkApi) => { try { - return (await fetchCompanyGroups(args)).map(toCompanyGroupRow); + return (await fetchCompanyGroups(args || {})).map(toCompanyGroupRow); } catch (e) { return thunkApi.rejectWithValue(e instanceof Error ? e.message : 'Ошибка'); } }, -) +); diff --git a/web/src/widgets/CatalogueGroupHeader/CatalogueGroupHeader.tsx b/web/src/widgets/CatalogueGroupHeader/CatalogueGroupHeader.tsx index 3e80a24..b7c1bf4 100644 --- a/web/src/widgets/CatalogueGroupHeader/CatalogueGroupHeader.tsx +++ b/web/src/widgets/CatalogueGroupHeader/CatalogueGroupHeader.tsx @@ -36,7 +36,7 @@ export const CompanyGroupHeader = ({ setEditFormOpen, setDeleteConfirmOpen }: Co key: 'delete', icon: activeCompanyGroup?.is_archived ? : , label: activeCompanyGroup?.is_archived ? 'Разархивировать' : 'Архивировать', - danger: activeCompanyGroup?.is_archived ? false : true, + danger: activeCompanyGroup?.is_archived, onClick: () => { setDeleteConfirmOpen(true); },