From 2115666f6ccbe59644ca7344f9d921f503b74cfe Mon Sep 17 00:00:00 2001 From: P0psicles Date: Wed, 10 Aug 2016 20:54:47 +0200 Subject: [PATCH] Have to use key/value. --- server/public/static/js/login.js | 2 +- server/web.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/public/static/js/login.js b/server/public/static/js/login.js index 1cd8327..d47a7cc 100644 --- a/server/public/static/js/login.js +++ b/server/public/static/js/login.js @@ -14,7 +14,7 @@ angular.module('myApp.login', ['ngRoute']) $scope.getPokemonList = function() { $http.get('/getPokemon').then(function(response){ - PokemonService.setPokemons(response.data); + PokemonService.setPokemons(response.data.pokemons); console.log(PokemonService.getPokemons()); $location.path('/pokemonList'); }); diff --git a/server/web.py b/server/web.py index aea8db7..5c8c49b 100644 --- a/server/web.py +++ b/server/web.py @@ -99,7 +99,8 @@ def getpokemon(): pokemons.append(pokemon_attributes) if pokemons: - return jsonify(sorted(pokemons, key=lambda k: k['IV'], reverse=True)) + #logging.info(str(pokemons)) + return jsonify(pokemons=sorted(pokemons, key=lambda k: k['IV'], reverse=True)) return []