Merge branch 'dev' of https://git.coopgo.io/coopgo-platform/fleets
This commit is contained in:
@@ -236,3 +236,14 @@ func (s MongoDBStorage) DeleteBooking(bookingid string) error {
|
||||
return err
|
||||
|
||||
}
|
||||
|
||||
/////////////////////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 {
|
||||
fmt.Println(err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ type Storage interface {
|
||||
CreateVehicle(Vehicle) error
|
||||
GetVehicle(id string) (*Vehicle, error)
|
||||
GetVehicles(namespaces []string) ([]Vehicle, error)
|
||||
UpdateVehicle(Vehicle) error
|
||||
|
||||
//Bookings management
|
||||
CreateBooking(Booking) error
|
||||
|
||||
Reference in New Issue
Block a user