Update media file interface and how bills are returned.
This commit is contained in:
@@ -33,6 +33,7 @@ export async function JobsListMedia(req: Request, res: Response) {
|
||||
]),
|
||||
thumbnailHeight: 250,
|
||||
thumbnailWidth: 250,
|
||||
filename: file.filename,
|
||||
};
|
||||
})
|
||||
);
|
||||
@@ -63,6 +64,7 @@ export async function JobsListMedia(req: Request, res: Response) {
|
||||
]),
|
||||
thumbnailHeight: 250,
|
||||
thumbnailWidth: 250,
|
||||
filename: file.name,
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
@@ -10,13 +10,13 @@ import { PathToRoFolder } from "../util/pathGenerators";
|
||||
|
||||
export async function JobsMoveMedia(req: Request, res: Response) {
|
||||
const jobid: string = (req.body.jobid || "").trim();
|
||||
const from_ro: string = (req.body.from_ro || "").trim();
|
||||
const from_jobid: string = (req.body.from_jobid || "").trim();
|
||||
const files: string[] = req.body.files; //Just file names.
|
||||
|
||||
//Validate the request is valid and contains everything that it needs.
|
||||
|
||||
if (from_ro === "") {
|
||||
res.status(400).json({ error: "from_ro must be specified. " });
|
||||
if (from_jobid === "") {
|
||||
res.status(400).json({ error: "from_jobid must be specified. " });
|
||||
return;
|
||||
}
|
||||
if (files.length === 0) {
|
||||
@@ -31,14 +31,14 @@ export async function JobsMoveMedia(req: Request, res: Response) {
|
||||
files.forEach((file) => {
|
||||
movingQueue.push(
|
||||
fs.move(
|
||||
path.join(FolderPaths.Jobs, from_ro, file),
|
||||
path.join(FolderPaths.Jobs, from_jobid, file),
|
||||
path.join(FolderPaths.Jobs, jobid, file)
|
||||
)
|
||||
);
|
||||
|
||||
movingQueue.push(
|
||||
fs.move(
|
||||
path.join(FolderPaths.Jobs, from_ro, FolderPaths.ThumbsSubDir, file),
|
||||
path.join(FolderPaths.Jobs, from_jobid, FolderPaths.ThumbsSubDir, file),
|
||||
path.join(FolderPaths.Jobs, jobid, FolderPaths.ThumbsSubDir, file)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user