diff --git a/app/controllers/api/v1/statuses/reactions_controller.rb b/app/controllers/api/v1/statuses/reactions_controller.rb index 9542d491c..333054f2a 100644 --- a/app/controllers/api/v1/statuses/reactions_controller.rb +++ b/app/controllers/api/v1/statuses/reactions_controller.rb @@ -7,7 +7,7 @@ class Api::V1::Statuses::ReactionsController < Api::BaseController before_action :require_user! before_action :set_status - def update + def create ReactService.new.call(current_account, @status, params[:id]) render_empty end diff --git a/app/javascript/flavours/glitch/actions/interactions.js b/app/javascript/flavours/glitch/actions/interactions.js index 1607231a3..924dcfca7 100644 --- a/app/javascript/flavours/glitch/actions/interactions.js +++ b/app/javascript/flavours/glitch/actions/interactions.js @@ -417,7 +417,7 @@ export const addReaction = (statusId, name) => (dispatch, getState) => { dispatch(addReactionRequest(statusId, name, alreadyAdded)); } - api(getState).put(`/api/v1/statuses/${statusId}/reactions/${name}`).then(() => { + api(getState).post(`/api/v1/statuses/${statusId}/react/${name}`).then(() => { dispatch(addReactionSuccess(statusId, name, alreadyAdded)); }).catch(err => { if (!alreadyAdded) { @@ -451,7 +451,7 @@ export const addReactionFail = (statusId, name, error) => ({ export const removeReaction = (statusId, name) => (dispatch, getState) => { dispatch(removeReactionRequest(statusId, name)); - api(getState).delete(`/api/v1/statuses/${statusId}/reactions/${name}`).then(() => { + api(getState).post(`/api/v1/statuses/${statusId}/unreact/${name}`).then(() => { dispatch(removeReactionSuccess(statusId, name)); }).catch(err => { dispatch(removeReactionFail(statusId, name, err)); diff --git a/app/javascript/mastodon/actions/interactions.js b/app/javascript/mastodon/actions/interactions.js index 900ac2cd7..f01841fe6 100644 --- a/app/javascript/mastodon/actions/interactions.js +++ b/app/javascript/mastodon/actions/interactions.js @@ -437,7 +437,7 @@ export const addReaction = (statusId, name) => (dispatch, getState) => { dispatch(addReactionRequest(statusId, name, alreadyAdded)); } - api(getState).put(`/api/v1/statuses/${statusId}/reactions/${name}`).then(() => { + api(getState).post(`/api/v1/statuses/${statusId}/react/${name}`).then(() => { dispatch(addReactionSuccess(statusId, name, alreadyAdded)); }).catch(err => { if (!alreadyAdded) { @@ -471,7 +471,7 @@ export const addReactionFail = (statusId, name, error) => ({ export const removeReaction = (statusId, name) => (dispatch, getState) => { dispatch(removeReactionRequest(statusId, name)); - api(getState).delete(`/api/v1/statuses/${statusId}/reactions/${name}`).then(() => { + api(getState).post(`/api/v1/statuses/${statusId}/unreact/${name}`).then(() => { dispatch(removeReactionSuccess(statusId, name)); }).catch(err => { dispatch(removeReactionFail(statusId, name, err));