Skip to content

Commit

Permalink
added ui t modal and api import text from a uploaded doc in ezgov pro…
Browse files Browse the repository at this point in the history
…ject
  • Loading branch information
bhatiadheeraj committed Jul 29, 2024
1 parent 6290dae commit ec3f88a
Show file tree
Hide file tree
Showing 5 changed files with 400 additions and 11 deletions.
4 changes: 3 additions & 1 deletion api/controllers/ezgov.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ router.get('/project/:projectId/file/:docId/getText', async (req, res) => {
} else {
return res.status(400).send('Unsupported file type. Only .docx, .pdf, and .txt files are supported for text extraction.');
}
return res.status(200).send(text);
if(text.length) return res.status(200).send(text);
else return res.status(400).send("Empty File");
});
} catch (err) {
console.error('Internal server error:', err);
Expand All @@ -395,5 +396,6 @@ router.get('/project/:projectId/file/:docId/getText', async (req, res) => {
});



module.exports = router;

Loading

0 comments on commit ec3f88a

Please sign in to comment.