This commit is contained in:
+28
-1
@@ -18,9 +18,36 @@ type Story struct {
|
||||
SortByFictionalDate bool `bson:"sortByFictionalDate"`
|
||||
}
|
||||
|
||||
func (story *Story) ApplyUpdate(update StoryUpdate) {
|
||||
if update.Name != nil {
|
||||
story.Name = *update.Name
|
||||
}
|
||||
if update.Category != nil {
|
||||
story.Category = *update.Category
|
||||
}
|
||||
if update.Author != nil {
|
||||
story.Author = *update.Author
|
||||
}
|
||||
if update.Open != nil {
|
||||
story.Open = *update.Open
|
||||
}
|
||||
if update.Listed != nil {
|
||||
story.Listed = *update.Listed
|
||||
}
|
||||
if update.SortByFictionalDate != nil {
|
||||
story.SortByFictionalDate = *update.SortByFictionalDate
|
||||
}
|
||||
if update.FictionalDate != nil {
|
||||
story.FictionalDate = *update.FictionalDate
|
||||
}
|
||||
if update.UpdatedDate != nil {
|
||||
story.UpdatedDate = *update.UpdatedDate
|
||||
}
|
||||
}
|
||||
|
||||
// IsChangeObject is an interface implementation to identify it as a valid
|
||||
// ChangeObject in GQL.
|
||||
func (*Story) IsChangeObject() {
|
||||
func (_ *Story) IsChangeObject() {
|
||||
panic("this method is a dummy, and so is its caller")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user