edit events proto en events.go for visualize history

This commit is contained in:
2023-02-15 10:14:06 +01:00
parent 1ce72b2f88
commit 822c053e78
6 changed files with 709 additions and 1215 deletions

View File

@@ -63,6 +63,8 @@ func (s MongoDBStorage) GetEvent(id string) (*Event, error) {
return nil, err
}
fmt.Printf("%+v\n", event)
return event, nil
}
@@ -132,7 +134,7 @@ func (s MongoDBStorage) UpdateSubscription(eventid string, subscriber string, de
for i := range event.Subscriptions {
if event.Subscriptions[i].Subscriber == subscriber {
filter := bson.M{"_id": eventid}
push := bson.M{"$push": bson.M{"deletesubscriptions": deletesubscription}}
push := bson.M{"$push": bson.M{"deletedsubscriptions": deletesubscription}}
pull := bson.M{"$pull": bson.M{"subscriptions": bson.M{"subscriber": subscriber}}}
_, er := collection.UpdateOne(context.TODO(), filter, push)
if _, err := collection.UpdateOne(context.TODO(), filter, pull); err != nil {