2022-04-12 10:50:01 +00:00
|
|
|
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
|
2023-04-05 08:39:00 +00:00
|
|
|
import type { ERROR_CODES } from "@appsmith/constants/ApiConstants";
|
|
|
|
|
import type { ErrorPayloadType } from "sagas/ErrorSagas";
|
|
|
|
|
|
|
|
|
|
export const safeCrashAppRequest = (code?: ERROR_CODES) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SAFE_CRASH_APPSMITH_REQUEST,
|
|
|
|
|
payload: {
|
|
|
|
|
code,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const safeCrashApp = (payload: ErrorPayloadType) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SAFE_CRASH_APPSMITH,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-12-17 07:03:59 +00:00
|
|
|
|
|
|
|
|
export const flushErrors = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.FLUSH_ERRORS,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const flushErrorsAndRedirect = (url: string) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.FLUSH_AND_REDIRECT,
|
|
|
|
|
payload: {
|
|
|
|
|
url,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|