diff --git a/src/endpoints/delete.ts b/src/endpoints/delete.ts index 8575d17..d1229d9 100644 --- a/src/endpoints/delete.ts +++ b/src/endpoints/delete.ts @@ -16,12 +16,10 @@ export default (app: Application) => { const fileName = req.params.name; const fileNamePattern = /^[a-zA-Z0-9]+\.(jpg|jpeg|png|mp4)$/; if (!fileNamePattern.test(fileName)) { - return res - .status(400) - .json({ - error: - 'Invalid file name. Please only use English Alphabet characters, 0-9. .jpg .jpeg .png .mp4 are the only supported file types', - }); + return res.status(400).json({ + error: + 'Invalid file name. Please only use English Alphabet characters, 0-9. .jpg .jpeg .png .mp4 are the only supported file types', + }); } const dir = resolve(dirname(''), 'src/files'); if (!existsSync(dir)) { diff --git a/src/endpoints/raw.ts b/src/endpoints/raw.ts index 4cc70f7..ac0640c 100644 --- a/src/endpoints/raw.ts +++ b/src/endpoints/raw.ts @@ -11,12 +11,10 @@ export default (app: Application) => { apiMessage(req.path, `User is trying to get a file - ${fileName}`); const fileNamePattern = /^[a-zA-Z0-9]+\.(jpg|jpeg|png|mp4)$/; if (!fileNamePattern.test(fileName)) { - return res - .status(400) - .json({ - error: - 'Invalid file name. Please only use English Alphabet characters, 0-9. .jpg .jpeg .png .mp4 are the only supported file types', - }); + return res.status(400).json({ + error: + 'Invalid file name. Please only use English Alphabet characters, 0-9. .jpg .jpeg .png .mp4 are the only supported file types', + }); } const dir = resolve(dirname(''), 'src/files'); if (!existsSync(dir)) { diff --git a/src/endpoints/save.ts b/src/endpoints/save.ts index 1ce30bc..e184c39 100644 --- a/src/endpoints/save.ts +++ b/src/endpoints/save.ts @@ -22,12 +22,10 @@ export default (app: Application) => { const fileName = nameHide ? `${generateID(10)}.${req.params.name.split('.')[1]}` : req.params.name; const fileNamePattern = /^[a-zA-Z0-9]+\.(jpg|jpeg|png|mp4)$/; if (!fileNamePattern.test(fileName)) { - return res - .status(400) - .json({ - error: - 'Invalid file name. Please only use English Alphabet characters, 0-9. .jpg .jpeg .png .mp4 are the only supported file types', - }); + return res.status(400).json({ + error: + 'Invalid file name. Please only use English Alphabet characters, 0-9. .jpg .jpeg .png .mp4 are the only supported file types', + }); } if (file.size > maxFileSize) { errorMessage('File is too big');