Skip to content

Commit

Permalink
Merge pull request #7 from GoLedgerDev/hotfix/updateRecursive
Browse files Browse the repository at this point in the history
Remove wrong verification of asset properties
  • Loading branch information
samuelvenzi authored May 6, 2022
2 parents 3d6f281 + 653b6d7 commit 73b08bd
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions assets/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,7 @@ func putRecursive(stub *sw.StubWrapper, object map[string]interface{}, root bool
return nil, errors.NewCCError("existing sub-asset could not be fetched", 404)
}

// if some property of the asset is different, we must update it
// otherwise we can return the existing asset. (we can't use DeepEqual because properties not sent should not be updated)
isDifferent := false
for k, v := range object {
if strings.HasPrefix(k, "@") {
continue
}

if v != asset[k] {
isDifferent = true
}
}

if !isDifferent {
return asset, nil
}
// TODO: check property by property if asset must be updated
}
}

Expand Down

0 comments on commit 73b08bd

Please sign in to comment.