Files
planka/client/src/actions/list.js

91 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import ActionTypes from '../constants/ActionTypes';
2020-03-25 00:15:47 +05:00
export const createList = (list) => ({
2019-08-31 04:07:25 +05:00
type: ActionTypes.LIST_CREATE,
payload: {
list,
},
});
createList.success = (localId, list) => ({
type: ActionTypes.LIST_CREATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
localId,
list,
},
});
createList.failure = (localId, error) => ({
type: ActionTypes.LIST_CREATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
localId,
error,
},
});
export const handleListCreate = (list) => ({
type: ActionTypes.LIST_CREATE_HANDLE,
2019-08-31 04:07:25 +05:00
payload: {
list,
},
});
export const updateList = (id, data) => ({
type: ActionTypes.LIST_UPDATE,
2019-08-31 04:07:25 +05:00
payload: {
id,
data,
},
});
updateList.success = (list) => ({
type: ActionTypes.LIST_UPDATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
list,
},
});
updateList.failure = (id, error) => ({
type: ActionTypes.LIST_UPDATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});
export const handleListUpdate = (list) => ({
type: ActionTypes.LIST_UPDATE_HANDLE,
2019-08-31 04:07:25 +05:00
payload: {
list,
},
});
export const deleteList = (id) => ({
type: ActionTypes.LIST_DELETE,
2019-08-31 04:07:25 +05:00
payload: {
id,
},
});
deleteList.success = (list) => ({
type: ActionTypes.LIST_DELETE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
list,
},
});
deleteList.failure = (id, error) => ({
type: ActionTypes.LIST_DELETE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});
export const handleListDelete = (list) => ({
type: ActionTypes.LIST_DELETE_HANDLE,
2019-08-31 04:07:25 +05:00
payload: {
list,
},
});