Skip to content

Conversation

@Milanka00
Copy link
Contributor

Purpose

Following is the current behaviour of create & publish API product.

  1. For errors,
  • In the flow, createAndPublishAPIProduct invokes createAPIProduct()
  • .catch() inside createAPIProduct handles the error but does not rethrow it
  • Therefore .then() in createAndPublishAPIProduct still gets called
  • This results in alerting unwanted success alert and state issues in button as it set setIsRevisioning(true)
Screenshot 2025-10-16 at 11 39 49
  1. For sucess,
  • Duplicate product creation success alerts are coming as both createAndPublishAPIProduct and createAPIProduct() have defined them
Screenshot 2025-10-16 at 11 43 56

Approach

  • Let createAPIProduct() throw the errors so that both createAndPublishAPIProduct and createAPIProductOnly can handle them
  • Remove duplicate success alert from createAndPublishAPIProduct
  • Make the state changes at right place

Fixes wso2/api-manager/issues/4461

@sonarqubecloud
Copy link

@Krishanx92 Krishanx92 self-requested a review October 28, 2025 16:01
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.

[UI] Create button state not reset after API Product creation failure due to duplicate resources across base APIs

2 participants