diff --git a/src/components/App.js b/src/components/App.js index 0135e2d..6928ae9 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -25,10 +25,17 @@ class App extends Component { render() { return (
-
+
diff --git a/src/components/Migrations/MigrationSingle.js b/src/components/Migrations/MigrationSingle.js index 7acfd46..2fd124e 100644 --- a/src/components/Migrations/MigrationSingle.js +++ b/src/components/Migrations/MigrationSingle.js @@ -1,28 +1,22 @@ import React from 'react'; const MigrationSingle = ({ item }) => ( -
-
-
- {item.migration_status} -
-
-
  • {item.id}
  • -
  • {item.submit_time}
  • -
  • {item.domain}
  • -
  • {item.booked_time}
  • -
  • {item.original_server}
  • -
  • {item.new_server}
  • -
  • {item.username}
  • -
  • {item.brand}
  • -
  • {item.ticket_id}
  • -
  • {item.migration_status}
  • -
  • {item.agent_booked}
  • -
  • {item.migration_type}
  • -
    +
    +
    +
    +
      +
    • {item.migration_status}

    • +
    • {item.domain}
    • +
    • {item.booked_time}
    • +
    • {item.migration_status}
    • +
    • {item.id}
    • +
    + +
    + ); export default MigrationSingle; diff --git a/src/components/Migrations/Migrations.js b/src/components/Migrations/Migrations.js index a1e83c5..e892d0a 100644 --- a/src/components/Migrations/Migrations.js +++ b/src/components/Migrations/Migrations.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import axios from 'axios'; import MigrationSingle from './MigrationSingle'; import Error from './Error'; @@ -12,24 +13,25 @@ class Migrations extends Component { } componentDidMount() { - const url = `http://benjamyn.love:8000/migrations/`; + const url = `https://devapi.benjamyn.love/migrations/`; - fetch(url) + axios.get(url) .then((response) => { - return response.json(); - }) - .then((data) => { this.setState({ - migs: data - }) + migs: response.data + }); + }) + .catch((error) => { this.setState({ error: true }) - }); + }) + } + renderItems() { if (!this.state.error) { return this.state.migs.map((item) => (