delete reservation

This commit is contained in:
soukainna 2024-09-02 21:36:03 +02:00
parent ce5e5f7acb
commit 744af76df2
1 changed files with 4 additions and 4 deletions

View File

@ -225,12 +225,12 @@ func (s MongoDBStorage) GetBookingsForDriver(driver string) (bookings []Booking,
func (s MongoDBStorage) DeleteBooking(bookingid string) error { func (s MongoDBStorage) DeleteBooking(bookingid string) error {
collection := s.Client.Database(s.DbName).Collection(s.Collections["bookings"]) collection := s.Client.Database(s.DbName).Collection(s.Collections["bookings"])
_, err := collection.UpdateOne( _, err := collection.DeleteOne(
context.TODO(), context.TODO(),
bson.M{"_id": bookingid}, bson.M{"_id": bookingid},
bson.D{ // bson.D{
{"$set", bson.D{{"deleted", true}}}, // {"$set", bson.D{{"deleted", true}}},
}, // },
) )
return err return err