GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
409 B

  1. package comments
  2. import (
  3. "git.aiterp.net/rpdata/api/models"
  4. "github.com/globalsign/mgo/bson"
  5. )
  6. // Remove removes one comment.
  7. func Remove(comment models.Comment) error {
  8. return collection.RemoveId(comment.ID)
  9. }
  10. // RemoveChapter removes all comments for the given chapter.
  11. func RemoveChapter(chapter models.Chapter) error {
  12. _, err := collection.RemoveAll(bson.M{"chapterId": chapter.ID})
  13. return err
  14. }