mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Added check for running query and error handling for the same
This commit is contained in:
parent
a26d67a5af
commit
466361fc2f
1 changed files with 22 additions and 0 deletions
|
|
@ -266,6 +266,28 @@ export const createQueryPanelSlice = (set, get) => ({
|
|||
|
||||
let dataQuery = {};
|
||||
|
||||
//for viewer, if query is restricted throw unauthorized error
|
||||
if (query.restricted) {
|
||||
setResolvedQuery(queryId, {
|
||||
isLoading: false,
|
||||
metadata: {
|
||||
response: {
|
||||
statusCode: 401,
|
||||
responseBody: 'Unauthorized access',
|
||||
},
|
||||
},
|
||||
response: {
|
||||
statusCode: 401,
|
||||
responseBody: 'Unauthorized access',
|
||||
},
|
||||
});
|
||||
onEvent('onDataQueryFailure', queryEvents);
|
||||
return {
|
||||
statusCode: 401,
|
||||
responseBody: 'Unauthorized access',
|
||||
};
|
||||
}
|
||||
|
||||
//for viewer we will only get the environment id from the url
|
||||
const { currentAppEnvironmentId, environmentId } = app;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue