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