consistency
This commit is contained in:
parent
f4da965e5c
commit
c89a65d5b4
3 changed files with 20 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";
|
import { createRouter, createWebHistory } from "vue-router";
|
||||||
import Login from "@/views/Login.vue";
|
import Login from "@/views/Login.vue";
|
||||||
|
|
||||||
import { isAuthenticated } from "./authGuards";
|
import { isAuthenticated } from "./authGuards";
|
||||||
|
@ -6,7 +6,7 @@ import { loadAccountData } from "./accountGuard";
|
||||||
import { isSetup } from "./setupGuard";
|
import { isSetup } from "./setupGuard";
|
||||||
import { abilityAndNavUpdate } from "./adminGuard";
|
import { abilityAndNavUpdate } from "./adminGuard";
|
||||||
import type { PermissionType, PermissionSection, PermissionModule } from "@/types/permissionTypes";
|
import type { PermissionType, PermissionSection, PermissionModule } from "@/types/permissionTypes";
|
||||||
import { setMemberId } from "./memberGuard";
|
import { resetMemberStores, setMemberId } from "./memberGuard";
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
|
@ -75,6 +75,7 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-club-member",
|
name: "admin-club-member",
|
||||||
component: () => import("@/views/admin/members/Member.vue"),
|
component: () => import("@/views/admin/members/Member.vue"),
|
||||||
|
beforeEnter: [resetMemberStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":id/edit",
|
path: ":id/edit",
|
||||||
|
|
|
@ -17,3 +17,17 @@ export async function setMemberId(to: any, from: any, next: any) {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function resetMemberStores(to: any, from: any, next: any) {
|
||||||
|
const member = useMemberStore();
|
||||||
|
member.activeMember = null;
|
||||||
|
member.activeMemberObj = null;
|
||||||
|
|
||||||
|
useMembershipStore().$reset();
|
||||||
|
useCommunicationStore().$reset();
|
||||||
|
useMemberAwardStore().$reset();
|
||||||
|
useMemberExecutivePositionStore().$reset();
|
||||||
|
useMemberQualificationStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<MainTemplate>
|
<MainTemplate>
|
||||||
|
<template #headerInsert>
|
||||||
|
<RouterLink to="../" class="text-primary">zurück zur Liste</RouterLink>
|
||||||
|
</template>
|
||||||
<template #topBar>
|
<template #topBar>
|
||||||
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||||
<h1 class="font-bold text-xl h-8">
|
<h1 class="font-bold text-xl h-8">
|
||||||
|
|
Loading…
Reference in a new issue