Update try
This commit is contained in:
@@ -42,12 +42,13 @@ func NewAccessor(request *tools.APIRequest) *WorkflowExecutionMongoAccessor {
|
||||
}
|
||||
}
|
||||
|
||||
func (wfa *WorkflowExecutionMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||
if set.(*WorkflowExecution).State == 0 {
|
||||
func (wfa *WorkflowExecutionMongoAccessor) UpdateOne(set map[string]interface{}, id string) (utils.DBObject, int, error) {
|
||||
if set["state"] == nil {
|
||||
return nil, 400, errors.New("state is required")
|
||||
}
|
||||
realSet := WorkflowExecution{State: set.(*WorkflowExecution).State}
|
||||
return utils.GenericUpdateOne(&realSet, id, wfa, &WorkflowExecution{})
|
||||
return utils.GenericUpdateOne(map[string]interface{}{
|
||||
"state": set["state"],
|
||||
}, id, wfa, &WorkflowExecution{})
|
||||
}
|
||||
|
||||
func (a *WorkflowExecutionMongoAccessor) LoadOne(id string) (utils.DBObject, int, error) {
|
||||
|
||||
Reference in New Issue
Block a user