validator
This commit is contained in:
@@ -18,6 +18,10 @@ func (sma *StorageMongoAccessor) UpdateOne(set map[string]interface{}, id string
|
||||
}
|
||||
|
||||
func (sma *StorageMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, error) {
|
||||
err := sma.Validate(data.(*Storage))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
id, err := mongo.MONGOService.StoreOne(data.(*Storage), sma.GetType())
|
||||
if err != nil {
|
||||
sma.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
|
||||
|
Reference in New Issue
Block a user