Skip to content

Commit

Permalink
feat: preview for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sayinmehmet47 committed Nov 26, 2023
1 parent 24a4f0b commit 3712a84
Show file tree
Hide file tree
Showing 11 changed files with 1,436 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
26 changes: 24 additions & 2 deletions backend/routes/api/books.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ router.post(
async (req: Request, res: Response, next: NextFunction) => {
const id = req.body.id.toString().trim();

console.log(id);

try {
const data = await Books.findByIdAndRemove(id);

Expand Down Expand Up @@ -250,4 +248,28 @@ router.post('/updateBook', (req: Request, res: Response) => {
);
});

router.get('/getBookById/:id', (req: Request, res: Response) => {
const id = req.params.id;

console.log(id);

Books.findById(
id,
(
err: Error,
data: {
name: string;
url: string;
size: string;
uploader: string;
category: string[];
language: string;
}
) => {
if (err) console.log(err);
res.status(201).json(data);
}
);
});

module.exports = router;
Loading

0 comments on commit 3712a84

Please sign in to comment.