diff -r 34a75bd8d0b9 -r d48946d164c6 client/src/actions/sessionsActions.js --- a/client/src/actions/sessionsActions.js Tue Jul 25 19:11:26 2017 +0200 +++ b/client/src/actions/sessionsActions.js Fri Jul 28 19:40:35 2017 +0200 @@ -1,6 +1,8 @@ import { now } from '../utils'; +import { ActionEnum } from '../constants' import * as types from '../constants/actionTypes'; + export const createSession = (sessionId) => { const newSession = { @@ -9,24 +11,12 @@ date: now(), title: '', description: '', - deleted: false, - modified: true + action: ActionEnum.CREATED }; return { type: types.CREATE_SESSION, session: newSession, - meta: { - offline: { - effect: { - url: `/api/notes/sessions/`, - method: 'POST', - data: newSession - }, - commit: { type: types.NOOP }, - rollback: { type: types.NOOP } - } - } }; } @@ -35,17 +25,6 @@ type: types.UPDATE_SESSION, session: session, values: values, - meta: { - offline: { - effect: { - url: `/api/notes/sessions/${session.get('_id')}/`, - method: 'PUT', - data: values - }, - commit: { type: types.NOOP }, - rollback: { type: types.NOOP } - } - } }; } @@ -53,25 +32,27 @@ return { type: types.DELETE_SESSION, session: session, - meta: { - offline: { - effect: { - url: `/api/notes/sessions/${session.get('_id')}/`, - method: 'DELETE', - }, - commit: { type: types.NOOP }, - rollback: { type: types.NOOP } - } - } }; } +export const doDeleteSession = (sessionId) => { + return { type: types.DO_DELETE_SESSION, sessionId }; +} + export const loadSessions = () => { return { type: types.LOAD_SESSIONS } } +export const loadSession = (session) => { + return { type: types.LOAD_SESSION, session }; +} + +export const resetActionSession = (session) => { + return { type: types.RESET_ACTION_SESSION, session }; +} + export const createGroupAndUpdateSession = (session, name) => { const group = { name