Skip to content

Commit

Permalink
UIPQB-47: 400 error blocks save or further action in query builder (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
UladzislauKutarkin authored Sep 27, 2023
1 parent 5b3f068 commit 7146c3b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
* [UIPQB-46](https://issues.folio.org/browse/UIPQB-46) Incorrect text when no options available in the query builder's search bar.
* [UIPQB-50](https://issues.folio.org/browse/UIPQB-50)Add 'in-progress' handling to plugin-query-builder
* [UIPQB-48](https://issues.folio.org/browse/UIPQB-48) "Show columns" dropdown doesn't fit in the screen.
* [UIPQB-47](https://issues.folio.org/browse/UIPQB-47) 400 error blocks save or further action in query builder.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ export const QueryBuilderModal = ({
await cancelQuery({ queryId });
}
};
const handleCloseModal = async () => {
await handleCancelQuery();

const handleCloseModal = async (isCancel = true) => {
if (isCancel) {
await handleCancelQuery();
}

const src = await getSourceValue({
initialValues,
Expand All @@ -123,7 +126,7 @@ export const QueryBuilderModal = ({
fqlQuery,
});

await handleCloseModal();
await handleCloseModal(false);
};

const handleQueryRetrieved = (data) => {
Expand Down
5 changes: 4 additions & 1 deletion src/hooks/useTestQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export const useTestQuery = ({ testQueryDataSource, onQueryTestSuccess, onQueryT
} = useMutation({
mutationFn: ({ entityTypeId, fqlQuery }) => testQueryDataSource({ entityTypeId, fqlQuery }),
onSuccess: onQueryTestSuccess,
onError: onQueryTestFail,
onError: () => {
setIsTestQueryInProgress(false);
onQueryTestFail();
},
});

const { queryId } = testQueryData || {};
Expand Down

0 comments on commit 7146c3b

Please sign in to comment.