Skip to content
Snippets Groups Projects
Commit 25fee09c authored by Chif Gergő's avatar Chif Gergő
Browse files

Retrieve news by id

parent d599c83b
No related branches found
No related tags found
2 merge requests!10Feature/12 dev auto deploy,!6Feature/news api
import { Request, Response, NextFunction } from 'express';
import News from '../../models/NewsSchema';
const getNews = () => {
return (req: Request, res: Response, next: NextFunction) => {
News.findById(req.params.id, (error, result) => {
if(!error){
res.status(200);
res.json(result);
} else {
console.warn(error);
}
})
};
};
export default getNews;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment