Skip to content

Commit

Permalink
bugfix/ADCM-6173 get all clusters for host link action
Browse files Browse the repository at this point in the history
  • Loading branch information
workNpp authored and remizov-arena committed Dec 17, 2024
1 parent 8bf0078 commit 833e52b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions adcm-web/app/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export const emailRegexp = new RegExp(/^[^@ ]+@[^@ ]+\.[a-zA-Z]+$/);
export enum ActionStatuses {
SuccessRun = 'Action was launched successfully',
}

export const unlimitedRequestItems = 10000;
6 changes: 5 additions & 1 deletion adcm-web/app/src/store/adcm/hosts/hostsActionsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import { AdcmMaintenanceMode } from '@models/adcm';
import type { SortParams } from '@models/table';
import type { ModalState } from '@models/modal';
import { createCrudSlice } from '@store/createCrudSlice/createCrudSlice';
import { unlimitedRequestItems } from '@constants';

const loadClusters = createAsyncThunk('adcm/hostsActions/loadClusters', async (_arg, thunkAPI) => {
try {
const clusters = await AdcmClustersApi.getClusters();
const clusters = await AdcmClustersApi.getClusters(undefined, undefined, {
pageNumber: 0,
perPage: unlimitedRequestItems,
});
return clusters.results;
} catch (error) {
return thunkAPI.rejectWithValue(error);
Expand Down
4 changes: 2 additions & 2 deletions adcm-web/app/src/store/adcm/users/usersActionsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { AdcmCreateUserPayload, AdcmGroup, AdcmUser, UpdateAdcmUserPayload
import type { ModalState } from '@models/modal';
import { createCrudSlice } from '@store/createCrudSlice/createCrudSlice';
import type { SortParams } from '@models/table';
import { unlimitedRequestItems } from '@constants';

interface AdcmUsersActionState extends ModalState<AdcmUser, 'user'> {
updateDialog: {
Expand Down Expand Up @@ -114,8 +115,7 @@ const loadGroups = createAsyncThunk('adcm/usersActions/loadGroups', async (_, th
sortDirection: 'asc',
};
try {
const { count } = await AdcmGroupsApi.getGroups({}, sortParams);
return await AdcmGroupsApi.getGroups({}, sortParams, { pageNumber: 0, perPage: count });
return await AdcmGroupsApi.getGroups({}, sortParams, { pageNumber: 0, perPage: unlimitedRequestItems });
} catch (error) {
return thunkAPI.rejectWithValue(error);
}
Expand Down

0 comments on commit 833e52b

Please sign in to comment.