This commit is contained in:
@@ -23,6 +23,10 @@ func Edit(character models.Character, name, shortName, description *string) (mod
|
|||||||
changes["description"] = *description
|
changes["description"] = *description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(changes) == 0 {
|
||||||
|
return character, nil
|
||||||
|
}
|
||||||
|
|
||||||
err := collection.UpdateId(character.ID, bson.M{"$set": changes})
|
err := collection.UpdateId(character.ID, bson.M{"$set": changes})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return models.Character{}, err
|
return models.Character{}, err
|
||||||
|
|||||||
Reference in New Issue
Block a user