client/src/actions/notesActions.js
author ymh <ymh.work@gmail.com>
Mon, 19 Jun 2017 21:37:33 +0200
changeset 58 f16a080e0bc4
parent 29 4cfeabef7d5e
child 59 1eb52770eefa
permissions -rw-r--r--
on server, augment default token lifetime and add settings in .env to control it. Add the refresh endpoint

import uuidV1 from 'uuid/v1';

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

export const addNote = (session, data) => {
  return {
    type: types.ADD_NOTE,
    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,
    session: session
  }
}