Ability to mark image as a favorite or remove it
I would do the favorites routes differently than he proposed.
He had only a Put Route, so only updating and no create or delete routes:
PUT /image/<image-id>/favorite
that would make sense if it were only a flag or boolean on the image object:
image
is-favorit-bool
But we have more than one user: 10 users could have that one image as their fav and one user could have 30 favorites So instead I would create a favorites table with the foreign keys:
db table favorites
user_id | image_id
and as new routes:
Post /image/<image-id>/favorit
Delete /image/<image-id>/favorit
and keep
GET /me/favorites
GET /me/favorites/export
Edited by AA9358