Change RO number to jobid.
This commit is contained in:
@@ -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)
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user