21 lines
747 B
TypeScript
21 lines
747 B
TypeScript
import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspectionPlan";
|
|
import { useInspectionPointStore } from "@/stores/admin/unit/inspectionPlan/inspectionPoint";
|
|
|
|
export async function setInspectionPlanId(to: any, from: any, next: any) {
|
|
const inspectionPlanStore = useInspectionPlanStore();
|
|
inspectionPlanStore.activeInspectionPlan = to.params?.inspectionPlanId ?? null;
|
|
|
|
useInspectionPointStore().$reset();
|
|
|
|
next();
|
|
}
|
|
|
|
export async function resetInspectionPlanStores(to: any, from: any, next: any) {
|
|
const inspectionPlanStore = useInspectionPlanStore();
|
|
inspectionPlanStore.activeInspectionPlan = null;
|
|
inspectionPlanStore.activeInspectionPlanObj = null;
|
|
|
|
useInspectionPointStore().$reset();
|
|
|
|
next();
|
|
}
|