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

Merged
merged 2 commits into from
Nov 25, 2024

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.

@tharikaGitHub tharikaGitHub merged commit ea4f985 into wso2:main Nov 25, 2024
3 checks passed
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