client/src/actions/authActions.js
author Alexandre Segura <mex.zktk@gmail.com>
Wed, 28 Jun 2017 12:54:48 +0200
changeset 101 e165aa89ac82
parent 100 6fd752d98933
child 107 e6f85e26b08c
permissions -rw-r--r--
Add group dropdown, update session after group creation.

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

export const loginSubmit = (username, password) => {
  return {
    type: types.AUTH_LOGIN_SUBMIT,
    username,
    password
  };
}

export const logout = () => {
  return {
    type: types.AUTH_LOGOUT
  };
}

export const registerSubmit = (username, email, password1, password2) => {
  return {
    type: types.AUTH_REGISTER_SUBMIT,
    username,
    email,
    password1,
    password2
  };
}

export const createGroup = (name) => {
  const group = {
    name
  };

  return {
    type: types.GROUP_CREATE_ASYNC,
    group,
  };
}