|
@ -38,9 +38,9 @@ func Edit(log models.Log, title *string, event *string, description *string, ope |
|
|
// There can be only one open log. TODO: Transaction
|
|
|
// There can be only one open log. TODO: Transaction
|
|
|
if changes["open"] != nil && *open { |
|
|
if changes["open"] != nil && *open { |
|
|
query := bson.M{ |
|
|
query := bson.M{ |
|
|
|
|
|
"_id": bson.M{"$ne": log.ID}, |
|
|
"open": true, |
|
|
"open": true, |
|
|
"channel": log.ChannelName, |
|
|
"channel": log.ChannelName, |
|
|
"id": bson.M{"$ne": log.ID}, |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
go collection.UpdateAll(query, bson.M{"$set": bson.M{"open": false}}) |
|
|
go collection.UpdateAll(query, bson.M{"$set": bson.M{"open": false}}) |
|
|