Skip to content

Commit

Permalink
fix for an invalid reference link causing errors and not redirecting …
Browse files Browse the repository at this point in the history
…user to correct page
  • Loading branch information
soletsdev committed Jan 3, 2025
1 parent ec6494c commit 3eabfde
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<Wizard :ref="'wizard'" :wizard="wizardConfigSetup" :show-steps="false">
<Loading v-if="fetchingData" />
<Wizard v-else :ref="'wizard'" :wizard="wizardConfigSetup" :show-steps="false">
<template #header>
<v-container fluid class="bg-primary">
<v-container>
Expand Down Expand Up @@ -76,18 +77,23 @@ import type { Wizard as WizardType } from "@/types/wizard";
import { PortalInviteType, WorkExperienceType } from "@/utils/constant";
import Wizard from "../Wizard.vue";
import Loading from "../Loading.vue";
export default defineComponent({
name: "Reference",
components: { Wizard },
components: { Wizard, Loading },
async setup() {
const route = useRoute();
const router = useRouter();
const { data, error } = await getReference(route.params.token as string);
let wizardConfigSetup: WizardType | undefined = undefined;
//this variable prevents errors initializing the wizard when portal invitation in invalid which prevents redirecting the user to the invalid-reference page
let fetchingData = true;
if (error) {
router.push("/invalid-reference");
} else {
fetchingData = false;
}
const wizardStore = useWizardStore();
Expand Down Expand Up @@ -117,6 +123,7 @@ export default defineComponent({
wizardConfigSetup,
router,
route,
fetchingData,
};
},
computed: {
Expand Down

0 comments on commit 3eabfde

Please sign in to comment.