overhaul the FavoritesController to implement an API,
and retarget the web UI on top of this API.
note: /favorites was capable of adding favorite _anythings_,
not just courses - however, in a publicly documented API,
we don't want to encourage users to start creating
favorite files or sections or discussions and then
expect these to have meaning.
it would not be much effort to generalize the API a bit
(parameterizing the object type, but limiting the
allowed types to ["Course"] for the time being) -
if we think this won't make the documentation too
awkward. (we can, of course, make this change once
we actually _need_ it, without breaking backward
compatibility.)
test plan:
- make sure the web UI for course favorites works;
it has been retargeted on the API
- view the API documentation for Favorites;
verify that it was generated properly
- exercise the new APIs:
* GET /api/v1/users/self/favorites/courses
* POST /api/v1/users/self/favorites/courses/:id
* DELETE /api/v1/users/self/favorites/courses/:id
* DELETE /api/v1/users/self/favorites/courses
Change-Id: Ib4b6590af0202896846a5eb75f59a8fabb95fe6c
Reviewed-on: https://gerrit.instructure.com/12032
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>