update or create inspection versioned plan
This commit is contained in:
parent
95b6cec66d
commit
db3004fa04
13 changed files with 229 additions and 11 deletions
|
@ -6,7 +6,9 @@ import {
|
|||
getAllInspectionPlans,
|
||||
getAllInspectionPlansForRelated,
|
||||
getInspectionPlanById,
|
||||
getInspectionPointsByPlanId,
|
||||
updateInspectionPlanById,
|
||||
updateInspectionPointsByPlanId,
|
||||
} from "../../../controller/admin/unit/inspectionPlanController";
|
||||
|
||||
var router = express.Router({ mergeParams: true });
|
||||
|
@ -15,6 +17,10 @@ router.get("/", async (req: Request, res: Response) => {
|
|||
await getAllInspectionPlans(req, res);
|
||||
});
|
||||
|
||||
router.get("/:id/points", async (req: Request, res: Response) => {
|
||||
await getInspectionPointsByPlanId(req, res);
|
||||
});
|
||||
|
||||
router.get(
|
||||
["/vehicle/:relatedId", "/equipment/:relatedId", "/wearable/:relatedId"],
|
||||
async (req: Request, res: Response) => {
|
||||
|
@ -50,6 +56,14 @@ router.patch(
|
|||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:id/points",
|
||||
PermissionHelper.passCheckMiddleware("update", "unit", "inspection_plan"),
|
||||
async (req: Request, res: Response) => {
|
||||
await updateInspectionPointsByPlanId(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.delete(
|
||||
"/:id",
|
||||
PermissionHelper.passCheckMiddleware("delete", "unit", "inspection_plan"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue