diff --git a/models/workflow_execution/workflow_execution_mongo_accessor.go b/models/workflow_execution/workflow_execution_mongo_accessor.go index bf220ce..84aa407 100644 --- a/models/workflow_execution/workflow_execution_mongo_accessor.go +++ b/models/workflow_execution/workflow_execution_mongo_accessor.go @@ -43,7 +43,11 @@ func (wfa *workflowExecutionMongoAccessor) DeleteOne(id string) (utils.DBObject, } func (wfa *workflowExecutionMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) { - return nil, 404, errors.New("not implemented") + if set.(*WorkflowExecutions).State == 0 { + return nil, 400, errors.New("state is required") + } + realSet := WorkflowExecutions{State: set.(*WorkflowExecutions).State} + return utils.GenericUpdateOne(&realSet, id, wfa, &WorkflowExecutions{}) } func (wfa *workflowExecutionMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {