Skip to content
Snippets Groups Projects

Feature/news api

Merged chif requested to merge feature/news_api into dev
1 file
+ 18
0
Compare changes
  • Side-by-side
  • Inline
+ 18
0
 
import { Request, Response, NextFunction } from 'express';
 
import News from '../../models/NewsSchema';
 
 
 
const deleteNews = () => {
 
return (req: Request, res: Response, next: NextFunction) => {
 
News.findByIdAndDelete(req.params.id, (error, result) => {
 
if(!error){
 
res.status(204);
 
res.json({});
 
} else {
 
console.warn(error);
 
}
 
})
 
}
 
}
 
 
export default deleteNews;
 
\ No newline at end of file
Loading