src/frontend/packages/store/src/reducers/current-user-roles-reducer/user-favorites-groups.reducer.ts
Function userFavoriteGroupsReducer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function userFavoriteGroupsReducer(
state: IUserFavoritesGroupsState = getDefaultFavoriteGroupsState(),
action: Action
): IUserFavoritesGroupsState {
switch (action.type) {
Function removeFavoriteFromGroup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function removeFavoriteFromGroup(state: IUserFavoritesGroups, action: RemoveUserFavoriteSuccessAction): IUserFavoritesGroups {
const { favorite } = action;
const endpointGuid = getEndpointIDFromFavorite(favorite);
const userGroup = state[endpointGuid] || getDefaultFavoriteGroup();
// Favorite will not have and entityId if it is for an endpoint