Skip to content

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

Description

@AhmedNSidd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions