client/src/actions/groupActions.js
author salimr <riwad.salim@yahoo.fr>
Thu, 16 Aug 2018 22:32:36 +0200
changeset 146 4f4bb2b3ef39
parent 134 be36eed5e6e0
permissions -rw-r--r--
Removing Modal from react-bootstrap and adding react-modal

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
    }
  };
}