resolve conflict and fix
This commit is contained in:
@@ -18,7 +18,7 @@ type Booking struct {
|
||||
Unavailableto time.Time `json:"unavailableto"`
|
||||
Data map[string]any `json:"data"`
|
||||
|
||||
Deleted bool
|
||||
Deleted bool `json:"deleted"`
|
||||
Vehicle Vehicle `json:"vehicle" bson:"-"`
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,8 @@ func (s MongoDBStorage) GetBookingsForDriver(driver string) (bookings []Booking,
|
||||
func (s MongoDBStorage) DeleteBooking(bookingid string) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["bookings"])
|
||||
|
||||
fmt.Println(bookingid)
|
||||
|
||||
_, err := collection.UpdateOne(
|
||||
context.TODO(),
|
||||
bson.M{"_id": bookingid},
|
||||
@@ -237,7 +239,7 @@ func (s MongoDBStorage) DeleteBooking(bookingid string) error {
|
||||
|
||||
}
|
||||
|
||||
/////////////////////update///////////////
|
||||
// ///////////////////update///////////////
|
||||
func (s MongoDBStorage) UpdateVehicle(vehicle Vehicle) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["vehicles"])
|
||||
if _, err := collection.ReplaceOne(context.TODO(), bson.M{"_id": vehicle.ID}, vehicle); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user