diff --git a/webapp/src/App.js b/webapp/src/App.js index 71598e2..1915a39 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -3,14 +3,15 @@ import React, { useState, useEffect } from 'react'; function App() { - const [joke, setJoke] = useState(null); + const [activeGames, setActiveGames] = useState(null); useEffect(() => { - fetch('/api/badjokes') + fetch('/api/activegames') .then((response) => response.json()) - .then((data) => { - console.log(data.joke); - setJoke(data.joke); + .then((games) => { + console.log(games.ActiveGames.length); + console.log("games: " +games.ActiveGames); + setActiveGames(games.ActiveGames); }) .catch((err) => { console.log(err.message); @@ -21,7 +22,7 @@ function App() {

- Here is your joke: {joke ? {joke} : Loading...} + Here is list of your active games: {activeGames ? {activeGames} : Loading...}