validator err

This commit is contained in:
mr 2024-07-19 09:43:18 +02:00
parent 694957a483
commit 218714683b

View File

@ -1,8 +1,6 @@
package oclib package oclib
import ( import (
"fmt"
"cloud.o-forge.io/core/oc-lib/dbs/mongo" "cloud.o-forge.io/core/oc-lib/dbs/mongo"
"cloud.o-forge.io/core/oc-lib/models/utils" "cloud.o-forge.io/core/oc-lib/models/utils"
) )
@ -21,7 +19,7 @@ func (wfa *WorkflowMongoAccessor) UpdateOne(set map[string]interface{}, id strin
func (wfa *WorkflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, error) { func (wfa *WorkflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, error) {
err := utils.Validate.Struct(data) err := utils.Validate.Struct(data)
fmt.Println(err) wfa.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
if err != nil { if err != nil {
return nil, err return nil, err
} }