client/src/actions/groupActions.js
author salimr <riwad.salim@yahoo.fr>
Tue, 14 Aug 2018 20:39:55 +0200
changeset 144 8b950885ddae
parent 134 be36eed5e6e0
permissions -rw-r--r--
Add local font and assets. Override Bootstrap css varriables. Add specific css files

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