GroupID management
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 3m9s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 3m9s
This commit is contained in:
@@ -229,3 +229,20 @@ func (s MongoDBStorage) UpdateBookingStatus(bookingid string, newStatus string,
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) GetBookingsByGroupId(groupId string) ([]*types.Booking, error) {
|
||||
filter := bson.M{"groupid": groupId}
|
||||
|
||||
cursor, err := s.Collections.Bookings.Find(context.Background(), filter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer cursor.Close(context.Background())
|
||||
|
||||
var bookings []*types.Booking
|
||||
if err := cursor.All(context.Background(), &bookings); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return bookings, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user