Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mount: function(req) {
- return {
- title: req.param('title'),
- image: req.param('image'),
- thumbnail: req.param('thumbnail'),
- body: req.param('body'),
- tags: req.param('tags'),
- author: req.param('author_id'),
- status: req.param('status')
- }
- },
- create: function(req, res) {
- var article = this.mount(req);
- if (!article) {
- return false;
- }
- Article.create(article).exec(function(err, article) {
- if (err) {
- res.send(500, {
- status: 'error',
- error: err
- });
- }
- res.send(article);
- });
- }
Add Comment
Please, Sign In to add comment