-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Remove jQuery AJAX from the repo tag edit form #29526
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
Conversation
- Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the repo tag edit form functionality and it works as before Signed-off-by: Yarden Shoham <[email protected]>
web_src/js/features/repo-home.js
Outdated
if (xhr.responseJSON.invalidTopics.length > 0) { | ||
topicPrompts.formatPrompt = xhr.responseJSON.message; | ||
} catch (error) { | ||
if (error.response?.status === 422) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is error.response
? I don't think it's part of the fetch
standard. Also I think the logic is wrong because fetch will not throw on negative status codes. Fetch only throws on network errors, nothing else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it throws. I will fix it
* upstream/main: Remove jQuery AJAX from the repo tag edit form (go-gitea#29526)
Demo using
fetch
instead of jQuery AJAX