client/src/actions/groupActions.js
author ymh <ymh.work@gmail.com>
Tue, 28 Aug 2018 16:57:31 +0200
changeset 148 fcce52a159bc
parent 134 be36eed5e6e0
permissions -rw-r--r--
remove react-bootstrap - add a login dropdown component - add a group login component - remove reference to react-bootstrap

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