Skip to content

Commit

Permalink
🐛 fix query creation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andremacedopv committed Jan 13, 2023
1 parent 54afda1 commit ec505e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions transactions/deleteAssetType.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var DeleteAssetType = Transaction{
// Verify Asset Type usage
err = CheckUsedAssetTypes(stub, tagValue.(string), forceValue.(bool), forceCascadeValue.(bool))
if err != nil {
return nil, errors.WrapError(err, fmt.Sprintf("asset type '%s' is in use", tagValue.(string)))
return nil, errors.WrapError(err, "error checking asset type usage")
}

// Delete Asset Type
Expand All @@ -80,7 +80,7 @@ func CheckUsedAssetTypes(stub *sw.StubWrapper, tag string, force, cascade bool)
query := fmt.Sprintf(
`{
"selector": {
"@assetType": %s
"@assetType": "%s"
}
}`,
tag,
Expand All @@ -92,7 +92,7 @@ func CheckUsedAssetTypes(stub *sw.StubWrapper, tag string, force, cascade bool)
}

if resultsIterator.HasNext() && !force {
return errors.NewCCError("asset type is in use", http.StatusBadRequest)
return errors.NewCCError(fmt.Sprintf("asset type '%s' is in use", tag), http.StatusBadRequest)
}

for resultsIterator.HasNext() {
Expand Down

0 comments on commit ec505e9

Please sign in to comment.