Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable create new version button while handling submit #836

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jithmi004
Copy link
Contributor

Purpose

In publisher portal, clicking the "Create" button in the "Create New Version" page more than once during the process leads to duplicate entries.
Related to - wso2/api-manager#3256

Approach

To disable the "Create" button during the API version creation process, a new state isLoading is introduced to the CreateNewVersion component. Initially, isLoading is set to false. When the handleSubmit method is triggered, isLoading is set to true, which disables the "Create" button, preventing multiple submissions. After the API request completes, whether successfully or with an error, isLoading is reset to false, re-enabling the button.

Copy link

sonarcloud bot commented Nov 7, 2024

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.

2 participants