diff -r 7586b4a11c32 -r b2514a9bcd49 client/src/actions/sessionsActions.js --- a/client/src/actions/sessionsActions.js Tue Jun 20 12:11:57 2017 +0200 +++ b/client/src/actions/sessionsActions.js Tue Jun 20 14:13:15 2017 +0200 @@ -1,22 +1,38 @@ -import uuidV1 from 'uuid/v1'; +//import uuidV1 from 'uuid/v1'; import * as types from '../constants/actionTypes'; -export const createSession = () => { - return { - type: types.CREATE_SESSION_ASYNC, - session: { - _id: uuidV1(), +export const createSession = (sessionId) => { + + //const sessionId = uuidV1(); + const newSession = { + _id: sessionId, + ext_id: sessionId, date: new Date(), title: '', description: '', + }; + + return { + type: types.CREATE_SESSION, + session: newSession, + meta: { + offline: { + effect: { + url: "/api/notes/sessions/", + method: 'POST', + data: newSession + }, + commit: { type: types.CREATE_SESSION_ASYNC }, + rollback: { type: 'NoOp'} + } } }; } export const updateSession = (session, values) => { return { - type: types.UPDATE_SESSION_ASYNC, + type: types.UPDATE_SESSION, session: session, values: values, }; @@ -24,6 +40,6 @@ export const loadSessions = () => { return { - type: types.LOAD_SESSIONS_ASYNC + type: types.LOAD_SESSIONS } }