From 87bbf586dcf30f3803208968b7c757e88cdbe56b Mon Sep 17 00:00:00 2001 From: Jonathan Hornung Date: Fri, 23 Dec 2016 09:12:26 +0100 Subject: [PATCH] new version (v0.2.2) --- README.md | 9 ++++ bower.json | 2 +- demo/js/app.js | 12 ++--- dist/angular-footballdata-api-factory.js | 57 ++++++++++++-------- dist/angular-footballdata-api-factory.min.js | 4 +- package.json | 2 +- src/angular-footballdata-api-factory.js | 55 +++++++++++-------- 7 files changed, 86 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 96ae558..99d2777 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Author: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank)) //Show one Season footballdataFactory.getSeason({ id: '', + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -50,6 +51,7 @@ footballdataFactory.getSeason({ //List all available soccer seasons footballdataFactory.getSeasons({ season: '', // (optional) Default is the current year (4 digit), e.g: '2015' + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -64,6 +66,7 @@ footballdataFactory.getSeasons({ //Show one team. footballdataFactory.getTeam({ id: '', + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -78,6 +81,7 @@ footballdataFactory.getTeam({ //List all teams for a certain soccerseason footballdataFactory.getTeamsBySeason({ id: '', + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -92,6 +96,7 @@ footballdataFactory.getTeamsBySeason({ //Show all players for a certain team. footballdataFactory.getPlayersByTeam({ id: '', + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -107,6 +112,7 @@ footballdataFactory.getPlayersByTeam({ footballdataFactory.getLeagueTableBySeason({ id: '', matchday: '', // (optional) The current/last matchday is taken per default + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -137,6 +143,7 @@ footballdataFactory.getFixture({ footballdataFactory.getFixtures({ timeFrame: '', // (optional) The value of the timeFrame argument must start with either 'p' for past or 'n' for next. It is followed by a number in the range 1-99. league: '', // (optional) A (list of, comma separated) league-code(s). Default is unset. Get all league codes at http://api.football-data.org/docs/latest/index.html + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -151,6 +158,7 @@ footballdataFactory.getFixturesBySeason({ id: '', timeFrame: '', // (optional) The value of the timeFrame argument must start with either 'p' for past or 'n' for next. It is followed by a number in the range 1-99. matchday: '', // (optional) The current/last matchday is taken per default + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success @@ -166,6 +174,7 @@ footballdataFactory.getFixturesByTeam({ season: '', // (optional) Defaults to the current year, given as 4 digit like '2015' timeFrame: '', // (optional) The value of the timeFrame argument must start with either 'p' for past or 'n' for next. It is followed by a number in the range 1-99. venue: '', // (optional) Valid values: `home` and `away`. Default is unset. + protocol: '', // (optional) 'http', 'https', 'auto' apiKey: '', // Register for a free api key: http://api.football-data.org/register }).then(function (_data) { //on success diff --git a/bower.json b/bower.json index 6c80183..0d3ade0 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "authors": [ "Jonathan Hornung " ], - "version": "0.2.1", + "version": "0.2.2", "description": "angular factory for the football-data.org rest api", "main": "dist/angular-footballdata-api-factory.min.js", "moduleType": [], diff --git a/demo/js/app.js b/demo/js/app.js index 158667a..4f8f29e 100644 --- a/demo/js/app.js +++ b/demo/js/app.js @@ -4,14 +4,14 @@ app.controller('controller', ['$scope', 'footballdataFactory', function($scope, var apiKey = 'e42cb6a6ecc949c8897e06d284a55e05'; footballdataFactory.getSeasons({ - season: '2014', + season: '2015', apiKey: apiKey, }).then(function(_data){ console.info("getSeasons", _data); }); footballdataFactory.getSeason({ - id: '424', + id: '426', apiKey: apiKey, }).then(function(_data){ console.info("getSeason", _data); @@ -24,7 +24,7 @@ app.controller('controller', ['$scope', 'footballdataFactory', function($scope, }); footballdataFactory.getFixture({ - id: 149461, + id: 155048, apiKey: apiKey, }).then(function(_data){ console.info("getFixture", _data); @@ -52,14 +52,14 @@ app.controller('controller', ['$scope', 'footballdataFactory', function($scope, }); footballdataFactory.getTeamsBySeason({ - id: 351, + id: 424, apiKey: apiKey, }).then(function(_data){ console.info("getTeamsBySeason", _data); }); footballdataFactory.getLeagueTableBySeason({ - id: 351, + id: 426, matchday: 10, apiKey: apiKey, }).then(function(_data){ @@ -67,7 +67,7 @@ app.controller('controller', ['$scope', 'footballdataFactory', function($scope, }); footballdataFactory.getFixturesBySeason({ - id: 351, + id: 426, matchday: 10, apiKey: apiKey, }).then(function(_data){ diff --git a/dist/angular-footballdata-api-factory.js b/dist/angular-footballdata-api-factory.js index aa68f69..49f2b33 100644 --- a/dist/angular-footballdata-api-factory.js +++ b/dist/angular-footballdata-api-factory.js @@ -1,6 +1,6 @@ /** @name: angular-footballdata-api-factory - @version: 0.2.1 (20-12-2016) + @version: 0.2.2 (23-12-2016) @author: Jonathan Hornung @url: https://github.com/JohnnyTheTank/angular-footballdata-api-factory#readme @license: MIT @@ -155,8 +155,19 @@ angular.module("jtt_footballdata", []) return footballdataFactory; }]) .service('footballdataSearchDataService', function () { - this.getApiBaseUrl = function () { - return 'https://api.football-data.org/v1/'; + this.getApiBaseUrl = function (protocol) { + + switch (protocol) { + case 'http': + case 'https': + protocol += ':'; + break; + + default: + protocol = ''; + } + + return protocol + '//api.football-data.org/v1/'; }; this.fillDataInObjectByList = function (_object, _params, _list) { @@ -180,72 +191,72 @@ angular.module("jtt_footballdata", []) switch (_type) { case "getSeasons": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'season', + 'protocol', 'apiKey', 'season', ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/'; break; case "getSeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', + 'protocol', 'apiKey', ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id; break; case "getTeam": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey' + 'protocol', 'apiKey' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'teams/' + _params.id; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id; break; case "getPlayersByTeam": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey' + 'protocol', 'apiKey' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'teams/' + _params.id + '/players'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/players'; break; case "getFixtures": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'league', 'timeFrame' + 'protocol', 'apiKey', 'league', 'timeFrame' ]); - footballdataSearchData.url = this.getApiBaseUrl() + '/fixtures'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures'; break; case "getFixture": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'head2head' + 'protocol', 'apiKey', 'head2head' ]); - footballdataSearchData.url = this.getApiBaseUrl() + '/fixtures/' + _params.id; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures/' + _params.id; break; case "getTeamsBySeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - + 'protocol', 'apiKey', ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id + '/teams'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/teams'; break; case "getLeagueTableBySeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'matchday' + 'protocol', 'apiKey', 'matchday' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id + '/leagueTable'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/leagueTable'; break; case "getFixturesBySeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'matchday', 'timeFrame' + 'protocol', 'apiKey', 'matchday', 'timeFrame' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id + '/fixtures'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/fixtures'; break; case "getFixturesByTeam": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'season', 'timeFrame', 'venue' + 'protocol', 'apiKey', 'season', 'timeFrame', 'venue' ]); - footballdataSearchData.url = this.getApiBaseUrl() + '/teams/' + _params.id + '/fixtures'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/fixtures'; break; } diff --git a/dist/angular-footballdata-api-factory.min.js b/dist/angular-footballdata-api-factory.min.js index 6043f82..4dbcc0e 100644 --- a/dist/angular-footballdata-api-factory.min.js +++ b/dist/angular-footballdata-api-factory.min.js @@ -1,8 +1,8 @@ /** @name: angular-footballdata-api-factory - @version: 0.2.1 (20-12-2016) + @version: 0.2.2 (23-12-2016) @author: Jonathan Hornung @url: https://github.com/JohnnyTheTank/angular-footballdata-api-factory#readme @license: MIT */ -"use strict";angular.module("jtt_footballdata",[]).factory("footballdataFactory",["$http","footballdataSearchDataService",function(a,b){var c={};return c.getSeasons=function(c){var d=b.getNew("getSeasons",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey}})},c.getSeason=function(c){var d=b.getNew("getSeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey}})},c.getTeam=function(c){var d=b.getNew("getTeam",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getPlayersByTeam=function(c){var d=b.getNew("getPlayersByTeam",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixtures=function(c){var d=b.getNew("getFixtures",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixture=function(c){var d=b.getNew("getFixture",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixturesByTeam=function(c){var d=b.getNew("getFixturesByTeam",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getTeamsBySeason=function(c){var d=b.getNew("getTeamsBySeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getLeagueTableBySeason=function(c){var d=b.getNew("getLeagueTableBySeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixturesBySeason=function(c){var d=b.getNew("getFixturesBySeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c}]).service("footballdataSearchDataService",function(){this.getApiBaseUrl=function(){return"https://api.football-data.org/v1/"},this.fillDataInObjectByList=function(a,b,c){return angular.forEach(c,function(c,d){angular.isDefined(b[c])&&(a.object[c]=b[c])}),a},this.getNew=function(a,b){var c={object:{},url:""};switch(a){case"getSeasons":c=this.fillDataInObjectByList(c,b,["apiKey","season"]),c.url=this.getApiBaseUrl()+"soccerseasons/";break;case"getSeason":c=this.fillDataInObjectByList(c,b,["apiKey"]),c.url=this.getApiBaseUrl()+"soccerseasons/"+b.id;break;case"getTeam":c=this.fillDataInObjectByList(c,b,["apiKey"]),c.url=this.getApiBaseUrl()+"teams/"+b.id;break;case"getPlayersByTeam":c=this.fillDataInObjectByList(c,b,["apiKey"]),c.url=this.getApiBaseUrl()+"teams/"+b.id+"/players";break;case"getFixtures":c=this.fillDataInObjectByList(c,b,["apiKey","league","timeFrame"]),c.url=this.getApiBaseUrl()+"/fixtures";break;case"getFixture":c=this.fillDataInObjectByList(c,b,["apiKey","head2head"]),c.url=this.getApiBaseUrl()+"/fixtures/"+b.id;break;case"getTeamsBySeason":c=this.fillDataInObjectByList(c,b,[]),c.url=this.getApiBaseUrl()+"soccerseasons/"+b.id+"/teams";break;case"getLeagueTableBySeason":c=this.fillDataInObjectByList(c,b,["apiKey","matchday"]),c.url=this.getApiBaseUrl()+"soccerseasons/"+b.id+"/leagueTable";break;case"getFixturesBySeason":c=this.fillDataInObjectByList(c,b,["apiKey","matchday","timeFrame"]),c.url=this.getApiBaseUrl()+"soccerseasons/"+b.id+"/fixtures";break;case"getFixturesByTeam":c=this.fillDataInObjectByList(c,b,["apiKey","season","timeFrame","venue"]),c.url=this.getApiBaseUrl()+"/teams/"+b.id+"/fixtures"}return c}}); \ No newline at end of file +"use strict";angular.module("jtt_footballdata",[]).factory("footballdataFactory",["$http","footballdataSearchDataService",function(a,b){var c={};return c.getSeasons=function(c){var d=b.getNew("getSeasons",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey}})},c.getSeason=function(c){var d=b.getNew("getSeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey}})},c.getTeam=function(c){var d=b.getNew("getTeam",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getPlayersByTeam=function(c){var d=b.getNew("getPlayersByTeam",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixtures=function(c){var d=b.getNew("getFixtures",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixture=function(c){var d=b.getNew("getFixture",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixturesByTeam=function(c){var d=b.getNew("getFixturesByTeam",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getTeamsBySeason=function(c){var d=b.getNew("getTeamsBySeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getLeagueTableBySeason=function(c){var d=b.getNew("getLeagueTableBySeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c.getFixturesBySeason=function(c){var d=b.getNew("getFixturesBySeason",c);return a({method:"GET",url:d.url,params:d.object,headers:{"X-Auth-Token":c.apiKey?c.apiKey:apiKey}})},c}]).service("footballdataSearchDataService",function(){this.getApiBaseUrl=function(a){switch(a){case"http":case"https":a+=":";break;default:a=""}return a+"//api.football-data.org/v1/"},this.fillDataInObjectByList=function(a,b,c){return angular.forEach(c,function(c,d){angular.isDefined(b[c])&&(a.object[c]=b[c])}),a},this.getNew=function(a,b){var c={object:{},url:""};switch(a){case"getSeasons":c=this.fillDataInObjectByList(c,b,["protocol","apiKey","season"]),c.url=this.getApiBaseUrl(c.object.protocol)+"soccerseasons/";break;case"getSeason":c=this.fillDataInObjectByList(c,b,["protocol","apiKey"]),c.url=this.getApiBaseUrl(c.object.protocol)+"soccerseasons/"+b.id;break;case"getTeam":c=this.fillDataInObjectByList(c,b,["protocol","apiKey"]),c.url=this.getApiBaseUrl(c.object.protocol)+"teams/"+b.id;break;case"getPlayersByTeam":c=this.fillDataInObjectByList(c,b,["protocol","apiKey"]),c.url=this.getApiBaseUrl(c.object.protocol)+"teams/"+b.id+"/players";break;case"getFixtures":c=this.fillDataInObjectByList(c,b,["protocol","apiKey","league","timeFrame"]),c.url=this.getApiBaseUrl(c.object.protocol)+"fixtures";break;case"getFixture":c=this.fillDataInObjectByList(c,b,["protocol","apiKey","head2head"]),c.url=this.getApiBaseUrl(c.object.protocol)+"fixtures/"+b.id;break;case"getTeamsBySeason":c=this.fillDataInObjectByList(c,b,["protocol","apiKey"]),c.url=this.getApiBaseUrl(c.object.protocol)+"soccerseasons/"+b.id+"/teams";break;case"getLeagueTableBySeason":c=this.fillDataInObjectByList(c,b,["protocol","apiKey","matchday"]),c.url=this.getApiBaseUrl(c.object.protocol)+"soccerseasons/"+b.id+"/leagueTable";break;case"getFixturesBySeason":c=this.fillDataInObjectByList(c,b,["protocol","apiKey","matchday","timeFrame"]),c.url=this.getApiBaseUrl(c.object.protocol)+"soccerseasons/"+b.id+"/fixtures";break;case"getFixturesByTeam":c=this.fillDataInObjectByList(c,b,["protocol","apiKey","season","timeFrame","venue"]),c.url=this.getApiBaseUrl(c.object.protocol)+"teams/"+b.id+"/fixtures"}return c}}); \ No newline at end of file diff --git a/package.json b/package.json index 2550a11..398f6d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-footballdata-api-factory", - "version": "0.2.1", + "version": "0.2.2", "description": "angularjs factory for footballdata jsonp rest api requests", "main": "dist/angular-footballdata-api-factory.min.js", "scripts": { diff --git a/src/angular-footballdata-api-factory.js b/src/angular-footballdata-api-factory.js index ebe169e..6e130c8 100644 --- a/src/angular-footballdata-api-factory.js +++ b/src/angular-footballdata-api-factory.js @@ -148,8 +148,19 @@ angular.module("jtt_footballdata", []) return footballdataFactory; }]) .service('footballdataSearchDataService', function () { - this.getApiBaseUrl = function () { - return 'https://api.football-data.org/v1/'; + this.getApiBaseUrl = function (protocol) { + + switch (protocol) { + case 'http': + case 'https': + protocol += ':'; + break; + + default: + protocol = ''; + } + + return protocol + '//api.football-data.org/v1/'; }; this.fillDataInObjectByList = function (_object, _params, _list) { @@ -173,72 +184,72 @@ angular.module("jtt_footballdata", []) switch (_type) { case "getSeasons": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'season', + 'protocol', 'apiKey', 'season', ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/'; break; case "getSeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', + 'protocol', 'apiKey', ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id; break; case "getTeam": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey' + 'protocol', 'apiKey' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'teams/' + _params.id; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id; break; case "getPlayersByTeam": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey' + 'protocol', 'apiKey' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'teams/' + _params.id + '/players'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/players'; break; case "getFixtures": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'league', 'timeFrame' + 'protocol', 'apiKey', 'league', 'timeFrame' ]); - footballdataSearchData.url = this.getApiBaseUrl() + '/fixtures'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures'; break; case "getFixture": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'head2head' + 'protocol', 'apiKey', 'head2head' ]); - footballdataSearchData.url = this.getApiBaseUrl() + '/fixtures/' + _params.id; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures/' + _params.id; break; case "getTeamsBySeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - + 'protocol', 'apiKey', ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id + '/teams'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/teams'; break; case "getLeagueTableBySeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'matchday' + 'protocol', 'apiKey', 'matchday' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id + '/leagueTable'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/leagueTable'; break; case "getFixturesBySeason": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'matchday', 'timeFrame' + 'protocol', 'apiKey', 'matchday', 'timeFrame' ]); - footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/' + _params.id + '/fixtures'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/fixtures'; break; case "getFixturesByTeam": footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [ - 'apiKey', 'season', 'timeFrame', 'venue' + 'protocol', 'apiKey', 'season', 'timeFrame', 'venue' ]); - footballdataSearchData.url = this.getApiBaseUrl() + '/teams/' + _params.id + '/fixtures'; + footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/fixtures'; break; }