client/src/actions/notesActions.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 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
  }
}