Cleaning session form. The group and protocol are no longer editable. Removing cruft
import { now } from '../utils';
import { ActionEnum } from '../constants'
import * as types from '../constants/actionTypes';
export const createSession = (sessionId, groupName, protocol) => {
const newSession = {
_id: sessionId,
ext_id: sessionId,
date: now(),
title: '',
description: '',
group: groupName,
protocol: protocol,
action: ActionEnum.CREATED
};
return {
type: types.CREATE_SESSION,
session: newSession,
};
}
export const updateSession = (session, values) => {
return {
type: types.UPDATE_SESSION,
session: session,
values: values,
};
}
export const deleteSession = (session) => {
return {
type: types.DELETE_SESSION,
session: session,
};
}
export const doDeleteSession = (sessionId) => {
return { type: types.DO_DELETE_SESSION, sessionId };
}
export const doDeleteAllSession = () => (
{ type: types.DO_DELETE_ALL_SESSION }
)
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 };
}