new grpc functions
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 34s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 34s
This commit is contained in:
@@ -210,9 +210,18 @@ func (s MongoDBStorage) GetBooking(id string) (*types.Booking, error) {
|
||||
return &res, nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) UpdateBookingStatus(bookingid string, newStatus string) error {
|
||||
func (s MongoDBStorage) UpdateBooking(booking types.Booking) error {
|
||||
// filter := bson.M{"_id": bookingid}
|
||||
replacement := bson.M{"$set": bson.M{"status": newStatus}}
|
||||
if _, err := s.Collections.Bookings.ReplaceOne(context.Background(), bson.M{"_id": booking.Id}, booking); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) UpdateBookingStatus(bookingid string, newStatus string, reason string) error {
|
||||
// filter := bson.M{"_id": bookingid}
|
||||
replacement := bson.M{"$set": bson.M{"status": newStatus, "data.reason": reason}}
|
||||
|
||||
if _, err := s.Collections.Bookings.UpdateByID(context.Background(), bookingid, replacement); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user