removed accounts ui + preparation for more group admin tools

This commit is contained in:
2458773093
2019-07-16 22:57:35 +03:00
parent 1d6564cf88
commit 7b2d3aa281
8 changed files with 204 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
import {
GROUP_MEMBERS_FETCH_SUCCESS,
GROUP_MEMBERS_EXPAND_SUCCESS,
GROUP_REMOVED_ACCOUNTS_FETCH_SUCCESS,
GROUP_REMOVED_ACCOUNTS_EXPAND_SUCCESS,
} from '../actions/groups';
const initialState = ImmutableMap({
@@ -35,6 +37,7 @@ const initialState = ImmutableMap({
blocks: ImmutableMap(),
mutes: ImmutableMap(),
groups: ImmutableMap(),
groups_removed_accounts: ImmutableMap(),
});
const normalizeList = (state, type, id, accounts, next) => {
@@ -83,6 +86,10 @@ export default function userLists(state = initialState, action) {
return normalizeList(state, 'groups', action.id, action.accounts, action.next);
case GROUP_MEMBERS_EXPAND_SUCCESS:
return appendToList(state, 'groups', action.id, action.accounts, action.next);
case GROUP_REMOVED_ACCOUNTS_FETCH_SUCCESS:
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);
default:
return state;
}