ff-admin/src/router/unit/inspectionPlan.ts

22 lines
751 B
TypeScript
Raw Normal View History

2025-04-11 14:14:11 +02:00
import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspectionPlan";
2025-07-09 16:01:15 +02:00
import { useInspectionPointStore } from "../../stores/admin/unit/inspectionPlan/inspectionPoint";
2025-04-11 14:14:11 +02:00
export async function setInspectionPlanId(to: any, from: any, next: any) {
const InspectionPlanStore = useInspectionPlanStore();
InspectionPlanStore.activeInspectionPlan = to.params?.inspectionPlanId ?? null;
2025-07-09 16:01:15 +02:00
useInspectionPointStore().$reset();
2025-04-11 14:14:11 +02:00
next();
}
export async function resetInspectionPlanStores(to: any, from: any, next: any) {
const InspectionPlanStore = useInspectionPlanStore();
InspectionPlanStore.activeInspectionPlan = null;
InspectionPlanStore.activeInspectionPlanObj = null;
2025-07-09 16:01:15 +02:00
useInspectionPointStore().$reset();
2025-04-11 14:14:11 +02:00
next();
}