Skip to content

Commit

Permalink
fix: not able to cancel enrolls
Browse files Browse the repository at this point in the history
  • Loading branch information
SamHep0803 authored Aug 30, 2024
1 parent 183aec9 commit cbbad60
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/routes/(hq)/[id]/training/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
}
let confirmCancelOpen = false;
let confirmUnenrollOpen = false;
let requestOpen = false;
let showRequestsOpen = false;
let transcriptCid: string;
async function cancelEnroll() {
await fetch("?/cancelEnroll", {
Expand All @@ -96,23 +101,19 @@
}
async function unenroll() {
await fetch("?/cancelEnrollment", {
await fetch("?/cancelEnroll", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Cookie: document.cookie,
},
});
confirmUnenrollOpen = false;
await invalidateAll();
toast.success("You've been unenrolled. Pick a new plan to start training.");
}
let confirmUnenrollOpen = false;
let requestOpen = false;
let showRequestsOpen = false;
let transcriptCid: string;
</script>

<div class="flex items-center justify-between">
Expand Down

0 comments on commit cbbad60

Please sign in to comment.