Fix for timeout being sent in a different location (#2708)
This commit is contained in:
parent
9e0f36a6f2
commit
40e42b296d
|
|
@ -5,7 +5,7 @@ import {
|
|||
DEFAULT_EXECUTE_ACTION_TIMEOUT_MS,
|
||||
} from "constants/ApiConstants";
|
||||
import axios, { AxiosPromise, CancelTokenSource } from "axios";
|
||||
import { Action } from "entities/Action";
|
||||
import { Action, ActionViewMode } from "entities/Action";
|
||||
|
||||
export interface CreateActionRequest<T> extends APIRequest {
|
||||
datasourceId: string;
|
||||
|
|
@ -127,7 +127,7 @@ class ActionAPI extends API {
|
|||
|
||||
static fetchActionsForViewMode(
|
||||
applicationId: string,
|
||||
): AxiosPromise<GenericApiResponse<Action[]>> {
|
||||
): AxiosPromise<GenericApiResponse<ActionViewMode[]>> {
|
||||
return API.get(`${ActionAPI.url}/view`, { applicationId });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,4 +108,13 @@ export interface QueryAction extends BaseAction {
|
|||
datasource: StoredDatasource;
|
||||
}
|
||||
|
||||
export type ActionViewMode = {
|
||||
id: string;
|
||||
name: string;
|
||||
pageId: string;
|
||||
jsonPathKeys: string[];
|
||||
confirmBeforeExecute?: boolean;
|
||||
timeoutInMillisecond?: number;
|
||||
};
|
||||
|
||||
export type Action = ApiAction | QueryAction;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import {
|
|||
} from "selectors/editorSelectors";
|
||||
import AnalyticsUtil from "utils/AnalyticsUtil";
|
||||
import { QUERY_CONSTANT } from "constants/QueryEditorConstants";
|
||||
import { Action } from "entities/Action";
|
||||
import { Action, ActionViewMode } from "entities/Action";
|
||||
import { ActionData } from "reducers/entityReducers/actionsReducer";
|
||||
import {
|
||||
getAction,
|
||||
|
|
@ -145,14 +145,22 @@ export function* fetchActionsForViewModeSaga(
|
|||
{ mode: "VIEWER", appId: applicationId },
|
||||
);
|
||||
try {
|
||||
const response: GenericApiResponse<Action[]> = yield ActionAPI.fetchActionsForViewMode(
|
||||
const response: GenericApiResponse<ActionViewMode[]> = yield ActionAPI.fetchActionsForViewMode(
|
||||
applicationId,
|
||||
);
|
||||
const correctFormatResponse = response.data.map((action) => {
|
||||
return {
|
||||
...action,
|
||||
actionConfiguration: {
|
||||
timeoutInMillisecond: action.timeoutInMillisecond,
|
||||
},
|
||||
};
|
||||
});
|
||||
const isValidResponse = yield validateResponse(response);
|
||||
if (isValidResponse) {
|
||||
yield put({
|
||||
type: ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS,
|
||||
payload: response.data,
|
||||
payload: correctFormatResponse,
|
||||
});
|
||||
PerformanceTracker.stopAsyncTracking(
|
||||
PerformanceTransactionName.FETCH_ACTIONS_API,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user