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

22 lines
747 B
TypeScript
Raw Normal View History

2025-04-11 14:14:11 +02:00
import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspectionPlan";
2025-07-12 17:13:32 +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) {
2025-07-11 09:42:07 +02:00
const inspectionPlanStore = useInspectionPlanStore();
inspectionPlanStore.activeInspectionPlan = to.params?.inspectionPlanId ?? null;
2025-04-11 14:14:11 +02:00
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) {
2025-07-11 09:42:07 +02:00
const inspectionPlanStore = useInspectionPlanStore();
inspectionPlanStore.activeInspectionPlan = null;
inspectionPlanStore.activeInspectionPlanObj = null;
2025-04-11 14:14:11 +02:00
2025-07-09 16:01:15 +02:00
useInspectionPointStore().$reset();
2025-04-11 14:14:11 +02:00
next();
}