This commit is contained in:
Allan Carr
2025-07-13 00:17:08 -07:00
parent 231130267f
commit 7f782d5a64
19 changed files with 2564 additions and 1416 deletions

View File

@@ -1,11 +1,16 @@
import { NextFunction, Request, Response } from "express";
export default function BillRequestValidator(req: Request, res: Response, next: NextFunction) {
const jobid: string = (req.body.jobid || "").trim();
if (jobid === "") {
res.status(400).json({ error: "No RO Number has been specified." });
return;
} else {
const validateBillRequest = (req: Request, res: Response, next: NextFunction) => {
try {
const jobid: string = (req.body.jobid || "").trim();
if (!jobid) {
res.status(400).json({ error: "No RO Number has been specified." });
return;
}
next();
} catch (error) {
res.status(500).json({ error: "Error validating job request.", details: (error as Error).message });
}
}
};
export default validateBillRequest;