client/src/actions/sessionsActions.js
author duong tam kien <tk@deveha.com>
Thu, 15 Jun 2017 16:51:24 +0200
changeset 41 aec51a27ca54
parent 30 4d93f4ed95bc
child 58 f16a080e0bc4
permissions -rw-r--r--
bootstrap of list of sessions

import uuidV1 from 'uuid/v1';

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

export const createSession = () => {
  return {
    type: types.CREATE_SESSION_ASYNC,
    session: {
      _id: uuidV1(),
      date: new Date(),
      title: '',
      description: '',
    }
  };
}

export const updateSession = (session, values) => {
  return {
    type: types.UPDATE_SESSION_ASYNC,
    session: session,
    values: values,
  };
}

export const loadSessions = () => {
  return {
    type: types.LOAD_SESSIONS_ASYNC
  }
}