correct type inspectionPlans request

This commit is contained in:
Julian Krauser 2025-07-11 09:42:04 +02:00
parent c42a41d895
commit 0f3e4488f4
2 changed files with 13 additions and 13 deletions

View file

@ -22,14 +22,14 @@ router.get("/:id/points", async (req: Request, res: Response) => {
});
router.get(
["/vehicle/:relatedId", "/equipment/:relatedId", "/wearable/:relatedId"],
["/vehicleType/:relatedTypeId", "/equipmentType/:relatedTypeId", "/wearableType/:relatedTypeId"],
async (req: Request, res: Response) => {
if (req.path.startsWith("/vehicle")) {
req.params.related = "vehicle";
} else if (req.path.startsWith("/equipment")) {
req.params.related = "equipment";
if (req.path.startsWith("/vehicleType")) {
req.params.related = "vehicleType";
} else if (req.path.startsWith("/equipmentType")) {
req.params.related = "equipmentType";
} else {
req.params.related = "wearable";
req.params.related = "wearableType";
}
await getAllInspectionPlansForRelated(req, res);