* 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>
17 lines
393 B
JavaScript
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();
|
|
};
|