Merge branch 'fix/runQueryTwice' into 'release'
Use isExecutionSuccess flag to handle query execution errors See merge request theappsmith/internal-tools-client!684
This commit is contained in:
commit
4322555d16
|
|
@ -251,25 +251,29 @@ export function* executeQuerySaga(
|
|||
},
|
||||
timeout,
|
||||
);
|
||||
const isValidResponse = yield validateResponse(response);
|
||||
const isExecutionSuccess = response.data.isExecutionSuccess;
|
||||
|
||||
if (response.responseMeta && response.responseMeta.error) {
|
||||
throw response.responseMeta.error;
|
||||
if (!isExecutionSuccess) {
|
||||
throw Error(response.data.body.toString());
|
||||
}
|
||||
|
||||
yield put({
|
||||
type: ReduxActionTypes.RUN_QUERY_SUCCESS,
|
||||
payload: {
|
||||
data: response.data,
|
||||
actionId: actionPayload.payload.actionId,
|
||||
},
|
||||
});
|
||||
AppToaster.show({
|
||||
message: "Query ran successfully",
|
||||
type: ToastType.SUCCESS,
|
||||
});
|
||||
AnalyticsUtil.logEvent("RUN_QUERY", {
|
||||
queryName: actionPayload.payload.action.name,
|
||||
});
|
||||
if (isValidResponse) {
|
||||
yield put({
|
||||
type: ReduxActionTypes.RUN_QUERY_SUCCESS,
|
||||
payload: {
|
||||
data: response.data,
|
||||
actionId: actionPayload.payload.actionId,
|
||||
},
|
||||
});
|
||||
AppToaster.show({
|
||||
message: "Query ran successfully",
|
||||
type: ToastType.SUCCESS,
|
||||
});
|
||||
AnalyticsUtil.logEvent("RUN_QUERY", {
|
||||
queryName: actionPayload.payload.action.name,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
yield put({
|
||||
type: ReduxActionErrorTypes.RUN_QUERY_ERROR,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user