add sortByFictionalDate field to Story, and sorting by fictional date if set.
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-08-28 22:45:13 +02:00
parent c4eabd69ac
commit 63bc262091
5 changed files with 79 additions and 36 deletions
+4
View File
@@ -145,6 +145,10 @@ func (r *storyRepository) Update(ctx context.Context, story models.Story, update
updateBson["listed"] = *update.Listed
story.Listed = *update.Listed
}
if update.SortByFictionalDate != nil {
updateBson["sortByFictionalDate"] = *update.SortByFictionalDate
story.SortByFictionalDate = *update.SortByFictionalDate
}
err := r.stories.UpdateId(story.ID, bson.M{"$set": updateBson})
if err != nil {