2019-08-31 04:07:25 +05:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const handleNotificationCreate = (notification, users, cards, activities) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: ActionTypes.NOTIFICATION_CREATE_HANDLE,
|
|
|
|
payload: {
|
|
|
|
notification,
|
|
|
|
users,
|
|
|
|
cards,
|
2022-08-04 13:31:14 +02:00
|
|
|
activities,
|
2021-06-24 01:05:22 +05:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const deleteNotification = (id) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: ActionTypes.NOTIFICATION_DELETE,
|
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
});
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
deleteNotification.success = (notification) => ({
|
|
|
|
type: ActionTypes.NOTIFICATION_DELETE__SUCCESS,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
notification,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
deleteNotification.failure = (id, error) => ({
|
|
|
|
type: ActionTypes.NOTIFICATION_DELETE__FAILURE,
|
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
error,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const handleNotificationDelete = (notification) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: ActionTypes.NOTIFICATION_DELETE_HANDLE,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
notification,
|
|
|
|
},
|
|
|
|
});
|
2022-08-04 13:31:14 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
handleNotificationCreate,
|
|
|
|
deleteNotification,
|
|
|
|
handleNotificationDelete,
|
|
|
|
};
|