import { push } from "react-router-redux";

import { requestRefreshEntries } from "../modules/entries";
import { addFeed } from "../modules/feeds";
import { requestCreateFeed, feedFormUpdate } from "../modules/feedForm";

export default function createFeedAction(feedAttributes) {
  return (dispatch) => {
    dispatch(feedFormUpdate());

    return requestCreateFeed(feedAttributes).
    then((response) => {
      const feed = response.data;
      // navigate to new feed
      dispatch(push(`/feeds/${feed.id}`));
      // update sidebar feed list
      dispatch(addFeed({ items: [feed] }));

      return response.data;
    }).
    catch((response) => {
      dispatch(feedFormUpdate({ errors: response.data.errors }));
      return response.data;
    });
  };
}

@@ -41,68 +41,8 @@
 %22;%0A%0A
-import %7B requestRefreshEntries %7D from %22../modules/entries%22;%0A
 impo

remove obsolete import