| author | ymh <ymh.work@gmail.com> |
| Tue, 20 Jun 2017 14:13:15 +0200 | |
| changeset 62 | b2514a9bcd49 |
| parent 59 | 1eb52770eefa |
| child 66 | f402435be429 |
| permissions | -rw-r--r-- |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
import uuidV1 from 'uuid/v1'; |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
|
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
import * as types from '../constants/actionTypes'; |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
|
| 15 | 5 |
export const addNote = (session, data) => { |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
return { |
|
62
b2514a9bcd49
migrate to redux-offline + various optimisation
ymh <ymh.work@gmail.com>
parents:
59
diff
changeset
|
7 |
type: types.ADD_NOTE, |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
note: { |
|
29
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
9 |
_id: uuidV1(), |
|
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
10 |
session: session._id, |
| 15 | 11 |
raw: data.raw, |
|
16
e67cd18cc594
Draft implementation of note timing.
Alexandre Segura <mex.zktk@gmail.com>
parents:
15
diff
changeset
|
12 |
plain: data.plain, |
|
17
877d8796b86d
Store serialized HTML in note.
Alexandre Segura <mex.zktk@gmail.com>
parents:
16
diff
changeset
|
13 |
html: data.html, |
|
16
e67cd18cc594
Draft implementation of note timing.
Alexandre Segura <mex.zktk@gmail.com>
parents:
15
diff
changeset
|
14 |
startedAt: data.startedAt, |
|
26
930e486ad0a8
Store categories in note.
Alexandre Segura <mex.zktk@gmail.com>
parents:
17
diff
changeset
|
15 |
finishedAt: data.finishedAt, |
|
930e486ad0a8
Store categories in note.
Alexandre Segura <mex.zktk@gmail.com>
parents:
17
diff
changeset
|
16 |
categories: data.categories, |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
} |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
}; |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
} |
|
29
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
20 |
|
|
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
21 |
export const loadNotesBySession = (session) => { |
|
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
22 |
return { |
|
62
b2514a9bcd49
migrate to redux-offline + various optimisation
ymh <ymh.work@gmail.com>
parents:
59
diff
changeset
|
23 |
type: types.LOAD_NOTES_BY_SESSION, |
|
29
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
24 |
session: session |
|
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
25 |
} |
|
4cfeabef7d5e
Store data in PouchDB.
Alexandre Segura <mex.zktk@gmail.com>
parents:
26
diff
changeset
|
26 |
} |