graph2: Changed Chapter to not return any comments if mode is disabled, even if there are comments.
the build was successful

This commit is contained in:
2019-01-16 22:05:40 +01:00
parent 22592439da
commit e3e3ea07db
+4
View File
@@ -29,6 +29,10 @@ func (r *chapterResolver) Comments(ctx context.Context, chapter *models.Chapter,
limitValue = *limit
}
if !chapter.CommentMode.IsEnabled() {
return nil, nil
}
return comments.ListChapterID(chapter.ID, limitValue)
}