consistency

This commit is contained in:
Julian Krauser 2024-09-18 10:38:57 +02:00
parent f4da965e5c
commit c89a65d5b4
3 changed files with 20 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";
import { createRouter, createWebHistory } from "vue-router";
import Login from "@/views/Login.vue";
import { isAuthenticated } from "./authGuards";
@ -6,7 +6,7 @@ import { loadAccountData } from "./accountGuard";
import { isSetup } from "./setupGuard";
import { abilityAndNavUpdate } from "./adminGuard";
import type { PermissionType, PermissionSection, PermissionModule } from "@/types/permissionTypes";
import { setMemberId } from "./memberGuard";
import { resetMemberStores, setMemberId } from "./memberGuard";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@ -75,6 +75,7 @@ const router = createRouter({
path: "",
name: "admin-club-member",
component: () => import("@/views/admin/members/Member.vue"),
beforeEnter: [resetMemberStores],
},
{
path: ":id/edit",

View file

@ -17,3 +17,17 @@ export async function setMemberId(to: any, from: any, next: any) {
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();
}

View file

@ -1,5 +1,8 @@
<template>
<MainTemplate>
<template #headerInsert>
<RouterLink to="../" class="text-primary">zurück zur Liste</RouterLink>
</template>
<template #topBar>
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
<h1 class="font-bold text-xl h-8">