client/src/actions/groupActions.js
author ymh <ymh.work@gmail.com>
Mon, 08 Oct 2018 18:35:47 +0200
changeset 168 ea92f4fe783d
parent 134 be36eed5e6e0
permissions -rw-r--r--
- move SlateEditor and dependencies to its own folder - remove Immutable - remove redux-persist-immutable - remobe redux-immutable - update libraries - added tests on store manipulations (accessor and reducers)

import * as types from '../constants/actionTypes';


export const groupCreateSuccess = (group) =>
  ({ type: types.GROUP_CREATE_SUCCESS, group });

export const groupCreateError = (error) =>
  ({ type: types.GROUP_CREATE_ERROR, error });

export const groupLoadSucess = (groups) =>
  ({ type: types.GROUP_LOAD_SUCCESS, groups });

export const groupLoadError = (error) =>
  ({ type: types.GROUP_LOAD_ERROR, error });

export const groupLoadAsync = () =>
  ({ type: types.GROUP_LOAD_ASYNC });

export const groupSetCurrent = (groupName) =>
  ({ type: types.GROUP_SET_GROUP, group: groupName });

export const createGroup = (name, description) => {
  return {
    type: types.GROUP_CREATE_ASYNC,
    group: {
      name,
      description
    }
  };
}