Merge branch 'modifyAnEvent' into dev

This commit is contained in:
soukainna
2023-02-22 14:17:53 +01:00
11 changed files with 743 additions and 23 deletions

View File

@@ -141,5 +141,12 @@ func (s MongoDBStorage) UpdateSubscription(eventid string, subscriber string, de
return er
}
}
func (s MongoDBStorage) UpdateEvent(event Event) error {
collection := s.Client.Database(s.DbName).Collection(s.Collections["events"])
if _, err := collection.ReplaceOne(context.TODO(), bson.M{"_id": event.ID}, event); err != nil {
fmt.Println(err)
return err
}
return nil
}