models, graph2: Added comment removal on chapter removal.
the build was successful

This commit is contained in:
2019-01-14 18:01:43 +01:00
parent f9fe0bb5f8
commit 39a4fef506
2 changed files with 23 additions and 0 deletions
+6
View File
@@ -7,6 +7,7 @@ import (
"git.aiterp.net/rpdata/api/models/changekeys"
"git.aiterp.net/rpdata/api/models/changes"
"git.aiterp.net/rpdata/api/models/comments"
"git.aiterp.net/rpdata/api/internal/auth"
"git.aiterp.net/rpdata/api/models/stories"
@@ -155,6 +156,11 @@ func (r *mutationResolver) RemoveChapter(ctx context.Context, input input.Chapte
return models.Chapter{}, errors.New("Failed to remove chapter: " + err.Error())
}
err = comments.RemoveChapter(chapter)
if err != nil {
return models.Chapter{}, errors.New("Chapter was removed, but comment removal failed: " + err.Error())
}
go func() {
story, err := stories.FindID(chapter.StoryID)
if err != nil {