removing removed accounts

This commit is contained in:
2458773093
2019-07-16 23:18:23 +03:00
parent 7b2d3aa281
commit f13214f1f9
3 changed files with 61 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ import {
GROUP_MEMBERS_EXPAND_SUCCESS,
GROUP_REMOVED_ACCOUNTS_FETCH_SUCCESS,
GROUP_REMOVED_ACCOUNTS_EXPAND_SUCCESS,
GROUP_REMOVED_ACCOUNTS_REMOVE_SUCCESS,
} from '../actions/groups';
const initialState = ImmutableMap({
@@ -90,6 +91,8 @@ export default function userLists(state = initialState, action) {
return normalizeList(state, 'groups_removed_accounts', action.id, action.accounts, action.next);
case GROUP_REMOVED_ACCOUNTS_EXPAND_SUCCESS:
return appendToList(state, 'groups_removed_accounts', action.id, action.accounts, action.next);
case GROUP_REMOVED_ACCOUNTS_REMOVE_SUCCESS:
return state.updateIn(['groups_removed_accounts', action.groupId, 'items'], list => list.filterNot(item => item === action.id));
default:
return state;
}