fix func get Subscriber
This commit is contained in:
		
							parent
							
								
									84e2db1b73
								
							
						
					
					
						commit
						498f5bc170
					
				| 
						 | 
				
			
			@ -170,31 +170,6 @@ func (s MongoDBStorage) GetSubscriber(subscriber string) ([]Subscription, error)
 | 
			
		|||
	}
 | 
			
		||||
	fmt.Println(subscriptions)
 | 
			
		||||
	return subscriptions, nil
 | 
			
		||||
	//return nil, nil
 | 
			
		||||
	// if err != nil {
 | 
			
		||||
	// 	return subscriptions, err
 | 
			
		||||
	// }
 | 
			
		||||
 | 
			
		||||
	// for cur.Next(context.TODO()) {
 | 
			
		||||
	// 	var event Event
 | 
			
		||||
	// 	var elem bson.M
 | 
			
		||||
 | 
			
		||||
	// 	if err := cur.Decode(&elem); err != nil {
 | 
			
		||||
	// 		return subscriptions, err
 | 
			
		||||
	// 	}
 | 
			
		||||
	// 	for i := range event.Subscriptions {
 | 
			
		||||
	// 		if event.Subscriptions[i].Subscriber == subscriber {
 | 
			
		||||
	// 			subscriptions = append(subscriptions, event.Subscriptions[i])
 | 
			
		||||
	// 		}
 | 
			
		||||
	// 	}
 | 
			
		||||
	// 	// bsonBytes, _ := bson.Marshal(elem)
 | 
			
		||||
	// 	// bson.Unmarshal(bsonBytes, &event)
 | 
			
		||||
 | 
			
		||||
	// 	// subscriptions = append(subscriptions, event.Subscriptions[1])
 | 
			
		||||
 | 
			
		||||
	// }
 | 
			
		||||
 | 
			
		||||
	// return subscriptions, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s MongoDBStorage) GetSubscriptionByUser(subscriber string) ([]Subscription, error) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue