Skip to content

Commit

Permalink
updated invalidations
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyAsh5114 committed Dec 23, 2023
1 parent 4f50f38 commit e02510c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/routes/mesocycles/[mode]/extras/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"content-type": "application/json"
}
});
await invalidate((url) => url.href.includes("/api/mesocycles/getAllMesocycleTemplates"));
callingEndpoint = false;
} else {
const requestBody: APIMesocyclesEditTemplate = {
Expand All @@ -97,6 +98,9 @@
"content-type": "application/json"
}
});
await invalidate(
`/api/mesocycles/getMesocycleTemplate?mesocycleTemplateId=${$editingMesocycleId}`
);
callingEndpoint = false;
}
if (!response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/mesocycles/view/[mesocycleId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
let redirecting = false;
async function closeMesocycleStoppedModal() {
redirecting = true;
await invalidate("mesocycle:active");
await invalidate((url) => url.href.includes("getActiveMesocycle"));
await goto("/mesocycles");
redirecting = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"content-type": "application/json"
}
});
await invalidate("mesocycle:active");
await invalidate((url) => url.href.includes("getActiveMesocycle"));
callingEndpoint = false;
if (response.ok) {
startSuccessfulModal.show();
Expand Down

0 comments on commit e02510c

Please sign in to comment.