Skip to content

Commit

Permalink
✨ Set event notification on update and delete of asset type list
Browse files Browse the repository at this point in the history
  • Loading branch information
andremacedopv committed Jan 20, 2023
1 parent 8660b11 commit c102bed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion transactions/deleteAssetType.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ var DeleteAssetType = Transaction{

assets.ReplaceAssetList(assetTypeList)

resBytes, err := json.Marshal(resArr)
err := assets.SetEventForList(stub)
if err != nil {
return nil, errors.WrapError(err, "failed to set event for asset list")
}

resBytes, nerr := json.Marshal(resArr)
if nerr != nil {
return nil, errors.WrapError(err, "failed to marshal response")
}

Expand Down
7 changes: 6 additions & 1 deletion transactions/updateAssetType.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ var UpdateAssetType = Transaction{
}
}

resBytes, err := json.Marshal(response)
err := assets.SetEventForList(stub)
if err != nil {
return nil, errors.WrapError(err, "failed to set event for asset list")
}

resBytes, nerr := json.Marshal(response)
if nerr != nil {
return nil, errors.WrapError(err, "failed to marshal response")
}

Expand Down

0 comments on commit c102bed

Please sign in to comment.