client/src/actions/notesActions.js
author duong tam kien <tk@deveha.com>
Thu, 15 Jun 2017 16:51:24 +0200
changeset 41 aec51a27ca54
parent 29 4cfeabef7d5e
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 addNote = (session, data) => {
  return {
    type: types.ADD_NOTE_ASYNC,
    note: {
      _id: uuidV1(),
      session: session._id,
      raw: data.raw,
      plain: data.plain,
      html: data.html,
      startedAt: data.startedAt,
      finishedAt: data.finishedAt,
      categories: data.categories,
    }
  };
}

export const loadNotesBySession = (session) => {
  return {
    type: types.LOAD_NOTES_BY_SESSION_ASYNC,
    session: session
  }
}