docbrown/app/javascript/actionsPanel/services/reactions.js
Gabriel Quaresma ed584ff5dc
Fix successfully passing incorrect tests in actionsPanel.test.js (#20674)
* first commit

Co-authored-by: Guilherme Nunes <guilherme.nunes.lopes@gmail.com>

* feat: implementt rollbackReactionButtonsState

* test: write new test cases

* refactor: update rollbackReactionButtonsState

---------

Co-authored-by: Guilherme Nunes <guilherme.nunes.lopes@gmail.com>
Co-authored-by: Mac Siri <mac@forem.com>
2024-03-04 16:58:38 +00:00

17 lines
393 B
JavaScript

export const postReactions = async ({
reactable_type,
category,
reactable_id,
}) => {
const response = await fetch('/reactions', {
method: 'POST',
headers: {
Accept: 'application/json',
'X-CSRF-Token': window.csrfToken,
'Content-Type': 'application/json',
},
body: { reactable_type, category, reactable_id },
});
return await response.json();
};