import React, { Component } from 'react'; import { fetchJSON } from '../http.jsx'; class PirateSearch extends Component { constructor() { super(); this.state = { response: [], name: '', } } sendToDownload(torrent) { console.log(torrent.magnet) let data = {magnet: torrent.magnet} fetchJSON('https://apollo.kevinmidboe.com/api/v1/pirate/add', 'POST', data) .then((response) => { console.log(response) }) } searchTheBay() { const query = this.props.name; const type = this.props.type; fetchJSON('https://apollo.kevinmidboe.com/api/v1/pirate/search?query='+query+'&type='+type, 'GET') .then((response) => { console.log(response.torrents) this.setState({ response: response.torrents.map((torrent, index) => { return (