validator

This commit is contained in:
mr
2024-07-18 18:14:12 +02:00
parent cc4cc49617
commit 4f4e2949d6
9 changed files with 47 additions and 1 deletions

View File

@@ -18,6 +18,10 @@ func (wfa *WorkflowMongoAccessor) UpdateOne(set map[string]interface{}, id strin
}
func (wfa *WorkflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, error) {
err := wfa.Validate(data.(*Workflow))
if err != nil {
return nil, err
}
id, err := mongo.MONGOService.StoreOne(data.(*Workflow), wfa.GetType())
if err != nil {
wfa.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())