import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants";
import { APP_MODE } from "../reducers/entityReducers/appReducer";
import { UpdateApplicationPayload } from "api/ApplicationApi";
export const setDefaultApplicationPageSuccess = (
pageId: string,
applicationId: string,
) => {
return {
type: ReduxActionTypes.SET_DEFAULT_APPLICATION_PAGE_SUCCESS,
payload: {
pageId,
applicationId,
},
};
export interface FetchApplicationPayload {
applicationId: string;
mode: APP_MODE;
}
export const fetchApplication = (
mode: APP_MODE,
): ReduxAction<FetchApplicationPayload> => {
type: ReduxActionTypes.FETCH_APPLICATION_INIT,
mode,
export const updateApplication = (
id: string,
data: UpdateApplicationPayload,
type: ReduxActionTypes.UPDATE_APPLICATION,
id,
...data,
export const publishApplication = (applicationId: string) => {
type: ReduxActionTypes.PUBLISH_APPLICATION_INIT,
export const duplicateApplication = (applicationId: string) => {
type: ReduxActionTypes.DUPLICATE_APPLICATION_INIT,
export const getAllApplications = () => {
type: ReduxActionTypes.GET_ALL_APPLICATION_INIT,