client/src/actions/sessionsActions.js
author ymh <ymh.work@gmail.com>
Mon, 19 Jun 2017 21:46:21 +0200
changeset 59 1eb52770eefa
parent 58 f16a080e0bc4
child 62 b2514a9bcd49
permissions -rw-r--r--
Backed out changeset f16a080e0bc4

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