Skip to content

Commit

Permalink
Merge pull request #8 from GoLedgerDev/hotfix/updateRecursive
Browse files Browse the repository at this point in the history
Fix recursive update with correct object assembly
  • Loading branch information
samuelvenzi authored May 6, 2022
2 parents 73b08bd + a404176 commit e0e28c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ func putRecursive(stub *sw.StubWrapper, object map[string]interface{}, root bool
return nil, errors.NewCCError("existing sub-asset could not be fetched", 404)
}

// If asset key is not in object, add asset value to object (so that properties are not erased)
for k := range asset {
if _, ok := object[k]; !ok {
object[k] = asset[k]
}
}

// TODO: check property by property if asset must be updated
}
}
Expand Down

0 comments on commit e0e28c5

Please sign in to comment.