diff --git a/script/util.js b/script/util.js index ec5e6da..a14d814 100644 --- a/script/util.js +++ b/script/util.js @@ -56,5 +56,10 @@ define(['m'], function(m) { ); }; + util.resultatsURL = function(){ + var cacheBuster = 1; + return "api/resultats.json?_=" + cacheBuster; + }; + return util; }); diff --git a/script/views/mainPage.js b/script/views/mainPage.js index 3ff618b..e129d5a 100644 --- a/script/views/mainPage.js +++ b/script/views/mainPage.js @@ -26,8 +26,7 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar nextGameDaySchedule.controller = function(){ var games = m.prop([]); - var cacheBuster = 1; - return m.request({method: "GET", url: "api/resultats.json?_=" + cacheBuster}) + return m.request({method: "GET", url: util.resultatsURL()}) .then(games) .then(resultParser.getNightGames) .then(function(nightGames){