1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/client/src/actions/notifications.js

70 lines
1.4 KiB
JavaScript
Raw Normal View History

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
2019-08-31 04:07:25 +05:00
import ActionTypes from '../constants/ActionTypes';
const deleteAllNotifications = () => ({
type: ActionTypes.ALL_NOTIFICATIONS_DELETE,
payload: {},
});
deleteAllNotifications.success = (notifications) => ({
type: ActionTypes.ALL_NOTIFICATIONS_DELETE__SUCCESS,
payload: {
notifications,
},
});
deleteAllNotifications.failure = (error) => ({
type: ActionTypes.ALL_NOTIFICATIONS_DELETE__FAILURE,
payload: {
error,
},
});
const handleNotificationCreate = (notification, users) => ({
type: ActionTypes.NOTIFICATION_CREATE_HANDLE,
payload: {
notification,
users,
},
});
2022-08-04 13:31:14 +02:00
const deleteNotification = (id) => ({
type: ActionTypes.NOTIFICATION_DELETE,
payload: {
id,
},
});
2019-08-31 04:07:25 +05:00
deleteNotification.success = (notification) => ({
type: ActionTypes.NOTIFICATION_DELETE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
notification,
},
});
deleteNotification.failure = (id, error) => ({
type: ActionTypes.NOTIFICATION_DELETE__FAILURE,
payload: {
id,
error,
},
});
2022-08-04 13:31:14 +02:00
const handleNotificationDelete = (notification) => ({
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 {
deleteAllNotifications,
2022-08-04 13:31:14 +02:00
handleNotificationCreate,
deleteNotification,
handleNotificationDelete,
};