30 lines
1 KiB
TypeScript
30 lines
1 KiB
TypeScript
import { useProtocolStore } from "@/stores/admin/protocol";
|
|
import { useProtocolAgendaStore } from "@/stores/admin/protocolAgenda";
|
|
import { useProtocolDecisionStore } from "@/stores/admin/protocolDecision";
|
|
import { useProtocolPresenceStore } from "@/stores/admin/protocolPresence";
|
|
import { useProtocolVotingStore } from "@/stores/admin/protocolVoting";
|
|
|
|
export async function setProtocolId(to: any, from: any, next: any) {
|
|
const protocol = useProtocolStore();
|
|
protocol.activeProtocol = to.params?.protocolId ?? null;
|
|
|
|
useProtocolAgendaStore().$reset();
|
|
useProtocolDecisionStore().$reset();
|
|
useProtocolPresenceStore().$reset();
|
|
useProtocolVotingStore().$reset();
|
|
|
|
next();
|
|
}
|
|
|
|
export async function resetProtocolStores(to: any, from: any, next: any) {
|
|
const protocol = useProtocolStore();
|
|
protocol.activeProtocol = null;
|
|
protocol.activeProtocolObj = null;
|
|
|
|
useProtocolAgendaStore().$reset();
|
|
useProtocolDecisionStore().$reset();
|
|
useProtocolPresenceStore().$reset();
|
|
useProtocolVotingStore().$reset();
|
|
|
|
next();
|
|
}
|