Skip to content

Commit

Permalink
Fix bug where server breaks when there are files within the root task…
Browse files Browse the repository at this point in the history
…s folder
  • Loading branch information
BaldissaraMatheus committed Jul 28, 2024
1 parent 21da3b9 commit a7ba168
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ const multerInstance = multer();

async function getLanesNames() {
await fs.promises.mkdir(process.env.TASKS_DIR, { recursive: true });
return fs.promises.readdir(process.env.TASKS_DIR);
return fs.promises.readdir(process.env.TASKS_DIR, { withFileTypes: true })
.then(dirs => dirs
.filter(dir => dir.isDirectory())
.map(dir => dir.name)
);
}

async function getMdFiles() {
Expand Down

0 comments on commit a7ba168

Please sign in to comment.