logic to update vehicles
This commit is contained in:
@@ -3,6 +3,8 @@ package handlers
|
||||
import (
|
||||
"time"
|
||||
|
||||
// "Documents/go_projet/go/pkg/mod/git.coopgo.io/coopgo-platform/fleets@v0.0.0-20230310144446-feb935f8bf4e/storage"
|
||||
|
||||
"git.coopgo.io/coopgo-platform/fleets/storage"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
@@ -56,3 +58,14 @@ func (h FleetsHandler) GetVehicles(namespaces []string, filters storage.VehicleF
|
||||
}
|
||||
return newvehicles, err
|
||||
}
|
||||
|
||||
/////////////////update///////////////
|
||||
func (h FleetsHandler) UpdateVehicle(vehicle storage.Vehicle) (*storage.Vehicle, error) {
|
||||
|
||||
// Store the account
|
||||
if err := h.storage.UpdateVehicle(vehicle); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &vehicle, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user