<commit_before>// import fetch from 'isomorphic-fetch';
import axios from 'axios';
import { authenticateUser } from '../auth/awsCognito.js';
import { browserHistory } from 'react-router';

export const BUY_EVENT = 'BUY_EVENT';

export function buyEvent(info, eventName) {
  const fromAddress = info.walletAddress.value;
  const name = info.name.value;

  return (dispatch) => {
    return axios.get('/api/events/?eventName='+eventName)
    .then(({ data }) => {
      const obj = {
        contractAddress: data.eventContractAddress,
        fromAddress: fromAddress,
        name: name,
        price:  data.price,
      };
      return axios.post('/api/tickets', obj)
      .then(() => {
        browserHistory.push('/events');
      });
    });
  };
}
<commit_msg>Changed add events route push to /hostevents<commit_after>// import fetch from 'isomorphic-fetch';
import axios from 'axios';
import { authenticateUser } from '../auth/awsCognito.js';
import { browserHistory } from 'react-router';

export const BUY_EVENT = 'BUY_EVENT';

export function buyEvent(info, eventName) {
  const fromAddress = info.walletAddress.value;
  const name = info.name.value;

  return (dispatch) => {
    return axios.get('/api/events/?eventName='+eventName)
    .then(({ data }) => {
      const obj = {
        contractAddress: data.eventContractAddress,
        fromAddress: fromAddress,
        name: name,
        price: data.price,
      };
      return axios.post('/api/tickets', obj)
      .then(() => {
        browserHistory.push('/hostevents');
      });
    });
  };
}

{'fraction_non_alphanumeric': 0.14604591836734693, 'fraction_numerical': 0.0, 'mean_word_length': 2.972151898734177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4192892', 'n_tokens_mistral': 479, 'n_tokens_neox': 474, 'n_words': 110}