2019-08-31 04:07:25 +05:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const initializeCore = (
|
2021-06-24 01:05:22 +05:00
|
|
|
user,
|
|
|
|
board,
|
|
|
|
users,
|
|
|
|
projects,
|
|
|
|
projectManagers,
|
|
|
|
boards,
|
|
|
|
boardMemberships,
|
|
|
|
labels,
|
|
|
|
lists,
|
|
|
|
cards,
|
|
|
|
cardMemberships,
|
|
|
|
cardLabels,
|
|
|
|
tasks,
|
|
|
|
attachments,
|
2022-08-04 13:31:14 +02:00
|
|
|
activities,
|
2021-06-24 01:05:22 +05:00
|
|
|
notifications,
|
|
|
|
) => ({
|
|
|
|
type: ActionTypes.CORE_INITIALIZE,
|
|
|
|
payload: {
|
|
|
|
user,
|
|
|
|
board,
|
|
|
|
users,
|
|
|
|
projects,
|
|
|
|
projectManagers,
|
|
|
|
boards,
|
|
|
|
boardMemberships,
|
|
|
|
labels,
|
|
|
|
lists,
|
|
|
|
cards,
|
|
|
|
cardMemberships,
|
|
|
|
cardLabels,
|
|
|
|
tasks,
|
|
|
|
attachments,
|
2022-08-04 13:31:14 +02:00
|
|
|
activities,
|
2021-06-24 01:05:22 +05:00
|
|
|
notifications,
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
});
|
2022-08-04 13:31:14 +02:00
|
|
|
|
2023-10-20 22:34:58 +02:00
|
|
|
// TODO: with success?
|
|
|
|
initializeCore.fetchConfig = (config) => ({
|
|
|
|
type: ActionTypes.CORE_INITIALIZE__CONFIG_FETCH,
|
|
|
|
payload: {
|
|
|
|
config,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2024-04-09 15:12:46 +02:00
|
|
|
const logout = (invalidateAccessToken) => ({
|
2022-08-04 13:31:14 +02:00
|
|
|
type: ActionTypes.LOGOUT,
|
2024-04-09 15:12:46 +02:00
|
|
|
payload: {
|
|
|
|
invalidateAccessToken,
|
|
|
|
},
|
2022-08-04 13:31:14 +02:00
|
|
|
});
|
|
|
|
|
2022-09-07 18:39:33 +05:00
|
|
|
logout.invalidateAccessToken = () => ({
|
|
|
|
type: ActionTypes.LOGOUT__ACCESS_TOKEN_INVALIDATE,
|
|
|
|
payload: {},
|
|
|
|
});
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
export default {
|
|
|
|
initializeCore,
|
|
|
|
logout,
|
|
|
|
};
|