Skip to content

Conversation

@dodo920306
Copy link
Contributor

Previously, deleteCallback always showed a success message regardless of whether the deleteAgent API call succeeded or failed.

Now it checks response.success before showing the message and only displays a success message when the API call is successful. An error message is shown otherwise.

This prevents misleading user feedback in case of deletion failure.

Previously, deleteCallback always showed a success message regardless of whether the
deleteAgent API call succeeded or failed.

Now it checks response.success before showing the message and only displays a success
message when the API call is successful. An error message is shown otherwise.

This prevents misleading user feedback in case of deletion failure.

Signed-off-by: dodo920306 <[email protected]>
@dodo920306
Copy link
Contributor Author

The build for this may also fail because the package.json is still unfixed.

@dodo920306
Copy link
Contributor Author

Also, shall we also combine https://github.com/hyperledger-cello/cello/pull/691/files#diff-403672fc815d806b49ea96bfe9925b72deba54aaba8301d41f86f16ffbeb75ffR286-L285

    if (userRole === 'admin') {
      dispatch({
        type: 'agent/deleteAgent',
        payload: agent.id,
        callback: this.deleteCallback,
      });
    } else {
      dispatch({
        type: 'agent/deleteAgent',
        payload: agent.id,
        callback: this.deleteCallback,
      });
    }

because they do the same thing?

@yeasy yeasy merged commit bfe9b58 into hyperledger-cello:main Jun 30, 2025
3 checks passed
@dodo920306 dodo920306 deleted the fix/show-delete-agent-successfully-without-checking-the-result branch July 1, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants