in a recent commit, I made some edits to how AJAX calls process responses, making better use of .done() and .always() functions. AJAX calls that perform updates or modifications of any sort now employ always() because those get called whether or not the response was successful (done() only gets called for successful calls, i.e. those with HTTP 200 responses). These new always() calls check the returned status, which if it's 200 then a successful response is processed.
many of these do not have else blocks to process unsuccessful responses. I added these blocks, but haven't filled them out yet, because that will require some additional UI work and testing that I didn't have time for just now. I did add todo comments in those blocks so it should be very apparent where the UI needs to trigger the display of error messages.
e.g.:
this ticket is a call to get back in there and fill these parts out.
in a recent commit, I made some edits to how AJAX calls process responses, making better use of
.done()
and.always()
functions. AJAX calls that perform updates or modifications of any sort now employalways()
because those get called whether or not the response was successful (done()
only gets called for successful calls, i.e. those withHTTP 200
responses). These newalways()
calls check the returned status, which if it's200
then a successful response is processed.many of these do not have
else
blocks to process unsuccessful responses. I added these blocks, but haven't filled them out yet, because that will require some additional UI work and testing that I didn't have time for just now. I did addtodo
comments in those blocks so it should be very apparent where the UI needs to trigger the display of error messages.e.g.:![image](https://github.com/OHSUCMP/coach/assets/979938/438328e4-d7fd-4369-b679-75552e52577d)
this ticket is a call to get back in there and fill these parts out.