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