logic to update vehicles

This commit is contained in:
soukainna
2023-05-19 11:26:36 +02:00
parent d48c1ccf8e
commit 41bf03682c
4 changed files with 41 additions and 3 deletions

View File

@@ -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
}