fixed some bugs

This commit is contained in:
ION606
2025-10-03 15:43:32 -04:00
parent 665fcbe191
commit b915ae88a4
+8 -2
View File
@@ -153,8 +153,13 @@ app.post('/dir', async (req, res) => {
try {
if (!req.fobj) return res.sendStatus(401);
const { fpath, deep } = req.fobj,
filesInDir = await client.getDirectoryContents(fpath, {
const { fpath, deep } = req.fobj;
if (!fpath) return res.sendStatus(400);
else if (!(await client.exists(fpath)) {
return res.status(404).send("Directory not found");
}
const filesInDir = await client.getDirectoryContents(fpath, {
deep
});
@@ -162,6 +167,7 @@ app.post('/dir', async (req, res) => {
}
catch (err) {
console.error(err);
res.sendStatus(500);
}
});