2019-08-31 04:07:25 +05:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
|
|
|
|
|
/* Actions */
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const createList = list => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_CREATE,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const updateList = (id, data) => ({
|
|
|
|
|
type: ActionTypes.LIST_UPDATE,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
data,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const deleteList = id => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_DELETE,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* Events */
|
|
|
|
|
|
|
|
|
|
export const createListRequested = (localId, data) => ({
|
|
|
|
|
type: ActionTypes.LIST_CREATE_REQUESTED,
|
|
|
|
|
payload: {
|
|
|
|
|
localId,
|
|
|
|
|
data,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const createListSucceeded = (localId, list) => ({
|
|
|
|
|
type: ActionTypes.LIST_CREATE_SUCCEEDED,
|
|
|
|
|
payload: {
|
|
|
|
|
localId,
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const createListFailed = (localId, error) => ({
|
|
|
|
|
type: ActionTypes.LIST_CREATE_FAILED,
|
|
|
|
|
payload: {
|
|
|
|
|
localId,
|
|
|
|
|
error,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const createListReceived = list => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_CREATE_RECEIVED,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const updateListRequested = (id, data) => ({
|
|
|
|
|
type: ActionTypes.LIST_UPDATE_REQUESTED,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
data,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const updateListSucceeded = list => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_UPDATE_SUCCEEDED,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const updateListFailed = (id, error) => ({
|
|
|
|
|
type: ActionTypes.LIST_UPDATE_FAILED,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
error,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const updateListReceived = list => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_UPDATE_RECEIVED,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const deleteListRequested = id => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_DELETE_REQUESTED,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const deleteListSucceeded = list => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_DELETE_SUCCEEDED,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const deleteListFailed = (id, error) => ({
|
|
|
|
|
type: ActionTypes.LIST_DELETE_FAILED,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
error,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2020-02-03 18:42:31 +05:00
|
|
|
export const deleteListReceived = list => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.LIST_DELETE_RECEIVED,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|