Skip to content
Snippets Groups Projects
Commit 57aa1005 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

dispatch chemicals search only on projects with disease

parent 177ce095
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!196Resolve "search in projects without disease defined"
Pipeline #90035 passed
......@@ -284,14 +284,14 @@ describe('BioEntitiesPinsListItem - component ', () => {
]),
);
expect(actions).toEqual(
expect.arrayContaining([
expect.objectContaining({
payload: undefined,
type: 'project/getSubmapConnectionsBioEntity/pending',
}),
]),
);
// expect(actions).toEqual(
// expect.arrayContaining([
// expect.objectContaining({
// payload: undefined,
// type: 'project/getSubmapConnectionsBioEntity/pending',
// }),
// ]),
// );
});
it('should reset reactions on fullName click', async () => {
......
......@@ -24,12 +24,25 @@ export const getSearchData = createAsyncThunk<
try {
dispatch(resetReactionsData());
await Promise.all([
dispatch(getMultiBioEntity({ searchQueries, isPerfectMatch })),
dispatch(getMultiDrugs(searchQueries)),
dispatch(getMultiChemicals(searchQueries)),
dispatch(getSubmapConnectionsBioEntity()),
]);
const project = getState().project.data;
let containsDisease = false;
if (project) {
containsDisease = project.disease !== undefined && project.disease !== null;
}
if (containsDisease) {
await Promise.all([
dispatch(getMultiBioEntity({ searchQueries, isPerfectMatch })),
dispatch(getMultiDrugs(searchQueries)),
dispatch(getMultiChemicals(searchQueries)),
dispatch(getSubmapConnectionsBioEntity()),
]);
} else {
await Promise.all([
dispatch(getMultiBioEntity({ searchQueries, isPerfectMatch })),
dispatch(getMultiDrugs(searchQueries)),
dispatch(getSubmapConnectionsBioEntity()),
]);
}
dispatchPluginsEvents(searchQueries, getState());
} catch (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment