about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-04 13:39:24 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-04 13:39:24 +0100
commit087b9938924b0f1f2e3fd81a3eb6e9cde0c3a074 (patch)
tree617a14dc509bee1e4e6298eebf4e17737ada4448 /app/assets/javascripts/components/actions
parent6d5ef89356e234b5208b5308fa00cf08459de831 (diff)
Adding list of who favourited status
Diffstat (limited to 'app/assets/javascripts/components/actions')
-rw-r--r--app/assets/javascripts/components/actions/interactions.jsx34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/actions/interactions.jsx b/app/assets/javascripts/components/actions/interactions.jsx
index 5b13fd02e..45f4508f6 100644
--- a/app/assets/javascripts/components/actions/interactions.jsx
+++ b/app/assets/javascripts/components/actions/interactions.jsx
@@ -199,3 +199,37 @@ export function fetchReblogsFail(id, error) {
     error
   };
 };
+
+export function fetchFavourites(id) {
+  return (dispatch, getState) => {
+    dispatch(fetchFavouritesRequest(id));
+
+    api(getState).get(`/api/v1/statuses/${id}/favourited_by`).then(response => {
+      dispatch(fetchFavouritesSuccess(id, response.data));
+    }).catch(error => {
+      dispatch(fetchFavouritesFail(id, error));
+    });
+  };
+};
+
+export function fetchFavouritesRequest(id) {
+  return {
+    type: FAVOURITES_FETCH_REQUEST,
+    id
+  };
+};
+
+export function fetchFavouritesSuccess(id, accounts) {
+  return {
+    type: FAVOURITES_FETCH_SUCCESS,
+    id,
+    accounts
+  };
+};
+
+export function fetchFavouritesFail(id, error) {
+  return {
+    type: FAVOURITES_FETCH_FAIL,
+    error
+  };
+};