Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

谢谢您的code,我想我发现了一个文档的bug,希望您看一下 #467

Open
byInWind opened this issue Jan 14, 2019 · 4 comments
Open

Comments

@byInWind
Copy link

提问方式:

  1. 请先从错误栈自己定位问题,尝试亲自解决问题
  2. 解决不了再去历史 isuue 里查看是否有相似的问题
  3. 最后,提交新的 issue,并将错误代码提交到你的 GitHub,我抽空会帮你调试

不好的提问方式:

  1. 只有标题,没有描述
  2. 描述不清楚
@byInWind
Copy link
Author

在4.9.1 文章模型设计,// GET /posts/:postId/remove 删除一篇文章
PostModel.delPostById(postId) .then(function () { req.flash('success', '删除文章成功') // 删除成功后跳转到主页 res.redirect('/posts') })
这里只有delPostById方法只传递了postId,我认为缺少了author,因为在models定义方法时需要传两个ID,并且我尝试删除文章时虽然提示成功,但是文章没有被删除,我加上author后删除成功了。
希望您有空时看一下

@nikolausliu
Copy link

nikolausliu commented Jan 18, 2019

@byInWind

并且我尝试删除文章时虽然提示成功,但是文章没有被删除,我加上author后删除成功了

我也遇到了这个问题,请问你这里的代码是怎么写的

@byInWind
Copy link
Author

在这里 PostModel.delPostById(postId)加上author
改为这样PostModel.delPostById(postId,author)
试一下吧

@nikolausliu
Copy link

@byInWind 好的,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants