Update media file interface and how bills are returned.
This commit is contained in:
@@ -56,13 +56,13 @@ export async function BillsUploadMedia(req: Request, res: Response) {
|
||||
|
||||
//for each file.path, generate the thumbnail.
|
||||
(req.files as Express.Multer.File[]).forEach((file) => {
|
||||
const vendor: string = (req.body.vendor || "").trim();
|
||||
const vendorid: string = (req.body.vendorid || "").trim();
|
||||
const invoice_number: string = (req.body.invoice_number || "").trim();
|
||||
|
||||
copyQueue.push(
|
||||
(async () => {
|
||||
const target: string = path.join(
|
||||
PathToVendorBillsFile(vendor),
|
||||
PathToVendorBillsFile(vendorid),
|
||||
file.filename
|
||||
);
|
||||
await fs.ensureDir(path.dirname(target));
|
||||
@@ -72,9 +72,8 @@ export async function BillsUploadMedia(req: Request, res: Response) {
|
||||
//Copy Queue is not awaited - we don't care if it finishes before we serve up the thumbnails from the jobs directory.
|
||||
});
|
||||
}
|
||||
res.sendStatus(200);
|
||||
|
||||
// BillsListMedia(req, res);
|
||||
BillsListMedia(req, res);
|
||||
}
|
||||
} catch (err) {
|
||||
res.status(500).send(err);
|
||||
|
||||
Reference in New Issue
Block a user