Change RO number to jobid.

This commit is contained in:
Patrick Fic
2022-05-04 18:13:21 -07:00
parent 05a8c90f03
commit 7754dc4653
10 changed files with 40 additions and 36 deletions

View File

@@ -9,7 +9,7 @@ import { JobsListMedia } from "./jobsListMedia";
import { PathToRoFolder } from "../util/pathGenerators";
export async function JobsMoveMedia(req: Request, res: Response) {
const ro_number: string = (req.body.ro_number || "").trim();
const jobid: string = (req.body.jobid || "").trim();
const from_ro: string = (req.body.from_ro || "").trim();
const files: string[] = req.body.files; //Just file names.
@@ -24,7 +24,7 @@ export async function JobsMoveMedia(req: Request, res: Response) {
return;
}
//Make sure the destination RO directory exists.
await fs.ensureDir(PathToRoFolder(ro_number));
await fs.ensureDir(PathToRoFolder(jobid));
const movingQueue: Promise<void>[] = [];
@@ -32,14 +32,14 @@ export async function JobsMoveMedia(req: Request, res: Response) {
movingQueue.push(
fs.move(
path.join(FolderPaths.Jobs, from_ro, file),
path.join(FolderPaths.Jobs, ro_number, file)
path.join(FolderPaths.Jobs, jobid, file)
)
);
movingQueue.push(
fs.move(
path.join(FolderPaths.Jobs, from_ro, FolderPaths.ThumbsSubDir, file),
path.join(FolderPaths.Jobs, ro_number, FolderPaths.ThumbsSubDir, file)
path.join(FolderPaths.Jobs, jobid, FolderPaths.ThumbsSubDir, file)
)
);
});