Start of ESM update
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import { NextFunction, Request, Response } from "express";
|
||||
|
||||
export default function ValidateJobBasedRequest(req: Request, res: Response, next: NextFunction) {
|
||||
const jobid: string = (req.body.jobid || "").trim();
|
||||
if (jobid === "") {
|
||||
res.status(400).json({ error: "No RO Number has been specified." });
|
||||
return;
|
||||
} else {
|
||||
next();
|
||||
export default function validateJobRequest(req: Request, res: Response, next: NextFunction) {
|
||||
const jobId: string = (req.body.jobid || "").trim();
|
||||
if (jobId === "") {
|
||||
return res.status(400).json({ error: "No RO Number has been specified." });
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response } from "express";
|
||||
import ft from "file-type";
|
||||
import core from "file-type/core";
|
||||
import { fileTypeFromFile } from "file-type";
|
||||
import { FileTypeResult } from "file-type/core";
|
||||
import fs from "fs-extra";
|
||||
import { logger } from "../server";
|
||||
import GenerateUrl from "../util/MediaUrlGen";
|
||||
@@ -24,7 +24,7 @@ export async function JobsListMedia(req: Request, res: Response) {
|
||||
|
||||
const relativeThumbPath: string = await GenerateThumbnail(relativeFilePath);
|
||||
|
||||
const type: core.FileTypeResult | undefined = await ft.fileTypeFromFile(relativeFilePath);
|
||||
const type: FileTypeResult | undefined = await fileTypeFromFile(relativeFilePath);
|
||||
|
||||
return {
|
||||
type,
|
||||
@@ -50,7 +50,7 @@ export async function JobsListMedia(req: Request, res: Response) {
|
||||
const relativeFilePath: string = JobRelativeFilePath(jobid, file.name);
|
||||
|
||||
const relativeThumbPath: string = await GenerateThumbnail(relativeFilePath);
|
||||
const type: core.FileTypeResult | undefined = await ft.fileTypeFromFile(relativeFilePath);
|
||||
const type: FileTypeResult | undefined = await fileTypeFromFile(relativeFilePath);
|
||||
const fileSize = await fs.stat(relativeFilePath);
|
||||
return {
|
||||
type,
|
||||
|
||||
Reference in New Issue
Block a user