The point of this PR is to make the reaction smoother by updating the DOM without refreshing (to avoid jumping back to the top at every interactions) and updating the DB with fetch
Javascript now handles selecting the correct path to fetch so we don't need the 3 different buttons per reaction anymore.
In order to respond to the Stimulus controller, the ReactionsController now only render json objects instead of redirecting or rendering ViewTemplates.
Summary of changes and context
The point of this PR is to make the reaction smoother by updating the DOM without refreshing (to avoid jumping back to the top at every interactions) and updating the DB with
fetch
Javascript now handles selecting the correct path to fetch so we don't need the 3 different buttons per reaction anymore.
In order to respond to the Stimulus controller, the ReactionsController now only render json objects instead of redirecting or rendering ViewTemplates.
https://github.com/pil0u/lewagon-aoc/assets/75388869/535d25b7-3c99-4e15-a3a0-3ba3069a308d
Sanity checks