aurora-(1636, 1693): обновление справочника гк и юл и исправлена фильтрация юл без гк #201

Merged
aep merged 7 commits from feat/companyGroupUpdate into main 2026-10-28 16:29:39 +03:00
3 changed files with 5 additions and 5 deletions
Showing only changes of commit ce539c4f35 - Show all commits

View File

@ -10,7 +10,7 @@ export const LE_PAGE = 200;
export async function fetchCompanyGroups(params: GetCompanyGroupsPropsI): Promise<ICompanyGroupOut[]> {
const all: ICompanyGroupOut[] = [];
for (let offset = 0; ; offset += CG_PAGE) {
const page = await api.get<Page<ICompanyGroupOut>>(`/directories/company-groups`, {
const page = await api.get<Page<ICompanyGroupOut>>('/directories/company-groups', {
limit: CG_PAGE,
offset: offset,
...params,

View File

@ -5,11 +5,11 @@ import type { GetCompanyGroupsPropsI } from './types';
export const getCompanyGroupsThunk = createAsyncThunk<ICompanyGroup[], GetCompanyGroupsPropsI | undefined, { rejectValue: string }>(
'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 : 'Ошибка');
}
},
)
);

View File

@ -36,7 +36,7 @@ export const CompanyGroupHeader = ({ setEditFormOpen, setDeleteConfirmOpen }: Co
key: 'delete',
icon: activeCompanyGroup?.is_archived ? <CheckCircleOutlined /> : <DeleteOutlined />,
label: activeCompanyGroup?.is_archived ? 'Разархивировать' : 'Архивировать',
danger: activeCompanyGroup?.is_archived ? false : true,
danger: activeCompanyGroup?.is_archived,
onClick: () => {
setDeleteConfirmOpen(true);
},