|
@ -84,23 +84,23 @@ func (story *Story) Edit(name, category *string, listed, open *bool, fictionalDa |
|
|
changes := bson.M{} |
|
|
changes := bson.M{} |
|
|
changed := *story |
|
|
changed := *story |
|
|
|
|
|
|
|
|
if name != nil && *name == story.Name { |
|
|
|
|
|
|
|
|
if name != nil && *name != story.Name { |
|
|
changes["name"] = *name |
|
|
changes["name"] = *name |
|
|
changed.Name = *name |
|
|
changed.Name = *name |
|
|
} |
|
|
} |
|
|
if category != nil && *category == story.Category { |
|
|
|
|
|
|
|
|
if category != nil && *category != story.Category { |
|
|
changes["category"] = *category |
|
|
changes["category"] = *category |
|
|
changed.Name = *category |
|
|
changed.Name = *category |
|
|
} |
|
|
} |
|
|
if listed != nil && *listed == story.Listed { |
|
|
|
|
|
|
|
|
if listed != nil && *listed != story.Listed { |
|
|
changes["listed"] = *listed |
|
|
changes["listed"] = *listed |
|
|
changed.Listed = *listed |
|
|
changed.Listed = *listed |
|
|
} |
|
|
} |
|
|
if open != nil && *open == story.Open { |
|
|
|
|
|
|
|
|
if open != nil && *open != story.Open { |
|
|
changes["open"] = *open |
|
|
changes["open"] = *open |
|
|
changed.Open = *open |
|
|
changed.Open = *open |
|
|
} |
|
|
} |
|
|
if fictionalDate != nil && *fictionalDate == story.FictionalDate { |
|
|
|
|
|
|
|
|
if fictionalDate != nil && !fictionalDate.Equal(story.FictionalDate) { |
|
|
changes["fictionalDate"] = *fictionalDate |
|
|
changes["fictionalDate"] = *fictionalDate |
|
|
changed.FictionalDate = *fictionalDate |
|
|
changed.FictionalDate = *fictionalDate |
|
|
} |
|
|
} |
|
|