21 lines
751 B
TypeScript
21 lines
751 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();
|
|
}
|