Skip to content

Commit

Permalink
Remove testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kathund committed Jan 15, 2024
1 parent cce7cde commit 8f95bb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/endpoints/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default (app: Application) => {
return res.status(400).json({ error: 'Invalid file name' });
}
const dir = resolve(dirname(''), 'src/files');
errorMessage(dir);
if (!existsSync(dir)) {
mkdirSync(dir, { recursive: true });
}
Expand All @@ -39,6 +38,7 @@ export default (app: Application) => {
errorMessage(`Error moving file: ${err}`);
return res.status(500).json({ success: false, message: 'Error occurred while saving the file' });
}
apiMessage(req.path, `File ${fileName} has been saved`);
return res.status(200).json({ success: !0, message: `File has been saved at ${url}/${fileName}` });
} catch (err) {
errorMessage(err as string);
Expand Down

0 comments on commit 8f95bb1

Please sign in to comment.