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

Use error callback for ajax requests in the codebase. #142

Open
AhmedNSidd opened this issue Jul 2, 2019 · 0 comments
Open

Use error callback for ajax requests in the codebase. #142

AhmedNSidd opened this issue Jul 2, 2019 · 0 comments
Labels
code-cleanup UVR Unassigned Version Releases

Comments

@AhmedNSidd
Copy link
Collaborator

Right now, there are instances in the js codebase where errors are being handled in the success callback. We need to fix this so the error callback handles the errors. Right now what we're (probably) doing is just returning a jsonresponse(json). What we should be doing is assigning jsonresponse(json) to a variable and then changing the status_code of that variable to the error status code that you want and then that will make sure the error callback is being called. Simply returning the jsonresponse the way we were doing it always returns a 200 status code and ajax thinks everything went well so it calls the success callback.

@AhmedNSidd AhmedNSidd added code-cleanup UVR Unassigned Version Releases labels Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-cleanup UVR Unassigned Version Releases
Projects
None yet
Development

No branches or pull requests

1 participant