inspection finish and print
This commit is contained in:
parent
0f3e4488f4
commit
9ef82adef7
12 changed files with 358 additions and 76 deletions
|
@ -8,7 +8,11 @@ import {
|
|||
getInspectionById,
|
||||
updateInspectionById,
|
||||
getAllInspectionsRunning,
|
||||
updateInspectionResults,
|
||||
getInspectionPrintoutById,
|
||||
finishInspection,
|
||||
} from "../../../controller/admin/unit/inspectionController";
|
||||
import { inspectionFileUpload } from "../../../middleware/multer";
|
||||
|
||||
var router = express.Router({ mergeParams: true });
|
||||
|
||||
|
@ -39,6 +43,10 @@ router.get("/:id", async (req: Request, res: Response) => {
|
|||
await getInspectionById(req, res);
|
||||
});
|
||||
|
||||
router.get("/:id/printout", async (req: Request, res: Response) => {
|
||||
await getInspectionPrintoutById(req, res);
|
||||
});
|
||||
|
||||
router.post(
|
||||
"/",
|
||||
PermissionHelper.passCheckMiddleware("create", "unit", "inspection"),
|
||||
|
@ -55,6 +63,23 @@ router.patch(
|
|||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:id/results",
|
||||
PermissionHelper.passCheckMiddleware("update", "unit", "inspection"),
|
||||
inspectionFileUpload,
|
||||
async (req: Request, res: Response) => {
|
||||
await updateInspectionResults(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
"/:id/finish",
|
||||
PermissionHelper.passCheckMiddleware("update", "unit", "inspection"),
|
||||
async (req: Request, res: Response) => {
|
||||
await finishInspection(req, res);
|
||||
}
|
||||
);
|
||||
|
||||
router.delete(
|
||||
"/:id",
|
||||
PermissionHelper.passCheckMiddleware("delete", "unit", "inspection"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue