This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package comments
|
||||
|
||||
import (
|
||||
"git.aiterp.net/rpdata/api/models"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
)
|
||||
|
||||
// Remove removes one comment.
|
||||
func Remove(comment models.Comment) error {
|
||||
return collection.RemoveId(comment.ID)
|
||||
}
|
||||
|
||||
// RemoveChapter removes all comments for the given chapter.
|
||||
func RemoveChapter(chapter models.Chapter) error {
|
||||
_, err := collection.RemoveAll(bson.M{"chapterId": chapter.ID})
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user