From b3e48ebdfae4ed8c7cc718d7f061e63e241fa9ad Mon Sep 17 00:00:00 2001 From: didier amyot Date: Thu, 2 Jun 2016 08:48:55 -0400 Subject: [PATCH] added cache buster in for all result url --- script/util.js | 5 +++++ script/views/mainPage.js | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) 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){