<commit_before>import React from 'react'
import {Form, FormGroup, FormControl, ControlLabel, Button} from 'react-bootstrap'
import axios from 'axios'

class Searcher extends React.Component {
  state = { isbnCode: '' }
  handleSubmit  = (event) => {
    console.log(this.state.isbnCode);
  	event.preventDefault();
    axios.get(`https://www.googleapis.com/books/v1/volumes?q=isbn:${this.state.isbnCode}`)
    	.then(results => {
        this.setState({ isbnCode: ''});
        if (results.data.totalItems) {
          
          // There'll be only 1 book per ISBN
          var book = results.data.items[0]["volumeInfo"];

          // Send book details to parent component
          this.props.onSubmit(book);              
        } else {
          // Send nothing to parent component
          this.props.onSubmit(null);              
        }<commit_msg>Utilizando Fetch invés do axios<commit_after>import React from 'react'
import {Form, FormGroup, FormControl, ControlLabel, Button} from 'react-bootstrap'

class Searcher extends React.Component {
  state = { isbnCode: '' }
  handleSubmit  = (event) => {
    console.log(this.state.isbnCode);
  	event.preventDefault();
    fetch(`https://www.googleapis.com/books/v1/volumes?q=isbn:${this.state.isbnCode}`)
    	.then(results => {
        console.log(results)
        this.setState({ isbnCode: ''});
        if (results.totalItems) {
          
          // There'll be only 1 book per ISBN
          var book = results.items[0]["volumeInfo"];
          console.log(book);
          // Send do parent component
          //this.props.onSubmit(resp.data);   
                 
        }
{'fraction_non_alphanumeric': 0.13122721749696234, 'fraction_numerical': 0.0036452004860267314, 'mean_word_length': 2.354378818737271, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5256178', 'n_tokens_mistral': 492, 'n_tokens_neox': 488, 'n_words': 105}