Skip to content

Commit

Permalink
Fix an error that happens when navigating to the second page of results
Browse files Browse the repository at this point in the history
  • Loading branch information
OrdiNeu committed Nov 25, 2024
1 parent bcf39b2 commit c92fcde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/views/clinicalGenomic/widgets/clinicalData.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ function ClinicalView() {

const HandlePageChange = (newModel) => {
if (newModel.page !== queryReader.query?.page) {
writerContext((old) => ({ ...old, query: { ...old.query, page: newModel.page, page_size: newModel.pageSize } }));
writerContext((old) => ({
...old,
query: { ...old.query, page: newModel.page, page_size: newModel.pageSize },
reqNum: old.reqNum + 1
}));
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/views/clinicalGenomic/widgets/searchExplainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ function SearchExplainer() {

// Decompose the query into its roots: what are we searching on?
if (query !== undefined) {
const ignoredKeys = ['page', 'page_size']; // These are never included in the explanation
Object.keys(query).forEach((key) => {
if (key !== undefined && query[key] !== undefined) {
if (key !== undefined && query[key] !== undefined && !ignoredKeys.includes(key)) {
const onDelete = () => {
writer((old) => ({ ...old, clear: key }));
};
Expand Down

0 comments on commit c92fcde

Please sign in to comment.