From df7e935390aceea21e5afbc9be9ef80f4693f9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sun, 2 Apr 2017 17:16:05 +0200 Subject: [PATCH] Clean GET params in ajax calls - Use `data` arg of `$.getJSON` for `format` param - Delete `dictToArray` call on data returned by `SingleResumeStat` class view since this view now returns stats manifest as an array --- kfet/static/kfet/js/statistic.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kfet/static/kfet/js/statistic.js b/kfet/static/kfet/js/statistic.js index 7ab56f1d..e6cc6132 100644 --- a/kfet/static/kfet/js/statistic.js +++ b/kfet/static/kfet/js/statistic.js @@ -42,8 +42,7 @@ $(this).addClass("focus"); // loads data and shows it - $.getJSON(this.stats_target_url + "?format=json", - displayStats); + $.getJSON(this.stats_target_url, {format: 'json'}, displayStats); } function displayStats (data) { @@ -158,7 +157,7 @@ "aria-label": "select-period"}); var to_click; - var context = dictToArray(data.stats); + var context = data.stats; for (var i = 0; i < context.length; i++) { // creates the button @@ -191,7 +190,7 @@ // constructor (function () { - $.getJSON(url + "?format=json", initialize); + $.getJSON(url, {format: 'json'}, initialize); })(); }; })(jQuery);