Package Updates
This commit is contained in:
@@ -5,11 +5,7 @@ import { logger } from "../server";
|
||||
import MediaFile from "../util/interfaces/MediaFile";
|
||||
import ListableChecker from "../util/listableChecker";
|
||||
import { PathToRoBillsFolder, PathToRoFolder } from "../util/pathGenerators";
|
||||
import {
|
||||
BillsRelativeFilePath,
|
||||
FolderPaths,
|
||||
JobRelativeFilePath,
|
||||
} from "../util/serverInit";
|
||||
import { BillsRelativeFilePath, FolderPaths, JobRelativeFilePath } from "../util/serverInit";
|
||||
|
||||
export async function JobsDeleteMedia(req: Request, res: Response) {
|
||||
const jobid: string = (req.body.jobid || "").trim();
|
||||
@@ -21,12 +17,12 @@ export async function JobsDeleteMedia(req: Request, res: Response) {
|
||||
// Setup lists for both file locations
|
||||
const jobFileList: fs.Dirent[] = (
|
||||
await fs.readdir(PathToRoFolder(jobid), {
|
||||
withFileTypes: true,
|
||||
withFileTypes: true
|
||||
})
|
||||
).filter((f) => f.isFile() && ListableChecker(f));
|
||||
const billFileList: fs.Dirent[] = (
|
||||
await fs.readdir(PathToRoBillsFolder(jobid), {
|
||||
withFileTypes: true,
|
||||
withFileTypes: true
|
||||
})
|
||||
).filter((f) => f.isFile() && ListableChecker(f));
|
||||
|
||||
@@ -37,12 +33,7 @@ export async function JobsDeleteMedia(req: Request, res: Response) {
|
||||
// File is in the set of requested files.
|
||||
await fs.remove(JobRelativeFilePath(jobid, file.name));
|
||||
await fs.remove(
|
||||
path.join(
|
||||
FolderPaths.Jobs,
|
||||
jobid,
|
||||
FolderPaths.ThumbsSubDir,
|
||||
file.name.replace(/\.[^/.]+$/, ".png")
|
||||
)
|
||||
path.join(FolderPaths.Jobs, jobid, FolderPaths.ThumbsSubDir, file.name.replace(/\.[^/.]+$/, ".png"))
|
||||
);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user