client/src/actions/notesActions.js
author Alexandre Segura <mex.zktk@gmail.com>
Wed, 31 May 2017 17:51:54 +0200
changeset 12 48ddaa42b810
parent 3 3b5d37d84cfe
child 15 4a8bbd314a46
permissions -rw-r--r--
Draft implementation of sessions. - Introduce react-router & add some pages. - Add login page (does nothing). - Allow creating a new session. - Allow adding notes into a session.

import uuidV1 from 'uuid/v1';

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

export const addNote = (session, text) => {
  return {
    type: types.ADD_NOTE,
    note: {
      id: uuidV1(),
      session: session.id,
      text: text,
    }
  };
}