27 lines
753 B
TypeScript
27 lines
753 B
TypeScript
import { Request, Response, NextFunction } from "express";
|
|
|
|
export default function BillRequestValidator(
|
|
req: Request,
|
|
res: Response,
|
|
next: NextFunction
|
|
) {
|
|
const vendorid: string = (req.body.vendorid || "").trim();
|
|
const invoice_number: string = (req.body.invoice_number || "").trim();
|
|
const jobid: string = (req.body.jobid || "").trim();
|
|
|
|
// if (vendor === "") {
|
|
// res.status(400).json({ error: "No vendor name has been specified." });
|
|
// return;
|
|
// }
|
|
// if (invoice_number === "") {
|
|
// res.status(400).json({ error: "No invoice number has been specified." });
|
|
// return;
|
|
// }
|
|
if (jobid === "") {
|
|
res.status(400).json({ error: "No RO Number has been specified." });
|
|
return;
|
|
} else {
|
|
next();
|
|
}
|
|
}
|