Skip to content

Commit

Permalink
Merge pull request #1636 from Vizzuality/MRXN23-569-gap-analysis-feat…
Browse files Browse the repository at this point in the history
…ures

[MRXN23-569]: fixes query invalidation after processing scenario features
  • Loading branch information
andresgnlez authored Jan 23, 2024
2 parents 0c20c31 + d08bc98 commit 9cfcfbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,25 +337,11 @@ const TargetAndSPFFeatures = (): JSX.Element => {
}),
};

selectedFeaturesMutation.mutate(
{
id: sid,
data,
},
{
onSuccess: async () => {
await queryClient.invalidateQueries(['selected-features', sid]);
},
}
);
}, [
sid,
queryClient,
selectedFeaturesMutation,
featureValues,
selectedFeaturesQuery.data,
targetedFeatures,
]);
selectedFeaturesMutation.mutate({
id: sid,
data,
});
}, [sid, selectedFeaturesMutation, featureValues, selectedFeaturesQuery.data, targetedFeatures]);

const handleRowValues = useCallback((id, values) => {
setFeatureValues((prevValues) => ({
Expand Down
5 changes: 4 additions & 1 deletion app/layout/scenarios/edit/status/actions/done.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,13 @@ export const useScenarioActionsDone = () => {
},
},
{
onSuccess: () => {
onSuccess: async () => {
dispatch(setJob(null));
dispatch(setCache(Date.now()));
dispatch(setSubTab(null));
await queryClient.invalidateQueries(['selected-features', sid]);
await queryClient.invalidateQueries(['targeted-features', sid]);
await queryClient.invalidateQueries(['pre-gap-analysis', sid]);
JOB_REF.current = null;
},
onError: () => {
Expand Down

1 comment on commit 9cfcfbe

@vercel
Copy link

@vercel vercel bot commented on 9cfcfbe Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marxan – ./

marxan-vizzuality1.vercel.app
marxan-git-develop-vizzuality1.vercel.app
marxan23.vercel.app

Please sign in to comment.