From a2d23a8d616530edb1ae3f333edd806da0ff7942 Mon Sep 17 00:00:00 2001 From: Jonathan Hornung Date: Thu, 10 Dec 2015 19:39:50 +0100 Subject: [PATCH] fix: fixed bug --- bower.json | 2 +- dist/angular-github-api-factory.min.js | 4 ++-- package.json | 2 +- src/angular-github-api-factory.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bower.json b/bower.json index f22b325..e9efa04 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-github-api-factory", "description": "angularjs factory for github json rest api requests", - "version": "0.1.0", + "version": "0.1.1", "main": "Gruntfile.js", "authors": [ "Jonathan Hornung" diff --git a/dist/angular-github-api-factory.min.js b/dist/angular-github-api-factory.min.js index 99325d6..4f7c448 100644 --- a/dist/angular-github-api-factory.min.js +++ b/dist/angular-github-api-factory.min.js @@ -1,3 +1,3 @@ -/*! angular-github-api-factory v0.1.0 (09-12-2015) by Jonathan Hornung */ -"use strict";angular.module("jtt_github",[]).factory("githubFactory",["$http","githubSearchDataService",function(a,b){var c={};return getRepoByUserAndNamegithubFactory.getUser=function(c){var d=b.getNew("user",c);return a({method:"GET",url:d.url,params:d.object})},c.getReposByUser=function(c){var d=b.getNew("reposByUser",c);return a({method:"GET",url:d.url,params:d.object})},c.getReposByName=function(c){var d=b.getNew("reposByName",c);return a({method:"GET",url:d.url,params:d.object})},c.getRepoByUserAndName=function(c){var d=b.getNew("repoByUserAndName",c);return a({method:"GET",url:d.url,params:d.object})},c.getEventsByUser=function(c){var d=b.getNew("eventsByUser",c);return a({method:"GET",url:d.url,params:d.object})},c.getEventsFromRepoByUserAndName=function(c){var d=b.getNew("eventsFromRepoByUserAndName",c);return a({method:"GET",url:d.url,params:d.object})},c}]).service("githubSearchDataService",function(){this.getApiBaseUrl=function(a){return"https://api.github.com/"},this.fillDataInObjectByList=function(a,b,c){return angular.forEach(c,function(c,d){"undefined"!=typeof b[c]&&(a.object[c]=b[c])}),a},this.getNew=function(a,b){var c=20,d={object:{},url:""};switch(a){case"user":d.object={access_token:b.access_token},d=this.fillDataInObjectByList(d,b,[]),d.url=this.getApiBaseUrl()+"users/"+b.user;break;case"reposByUser":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["q","sort","order","page"]),d.url=this.getApiBaseUrl()+"users/"+b.user+"/repos";break;case"reposByName":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["sort","order","page"]),d.url=this.getApiBaseUrl()+"search/repositories?q="+b.q;break;case"repoByUserAndName":d.object={access_token:b.access_token},d=this.fillDataInObjectByList(d,b,[]),d.url=this.getApiBaseUrl()+"repos/"+b.user+"/"+b.repo;break;case"eventsByUser":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["q","sort","order","page"]),d.url=this.getApiBaseUrl()+"users/"+b.user+"/events";break;case"eventsFromRepoByUserAndName":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["q","sort","order","page"]),d.url=this.getApiBaseUrl()+"repos/"+b.user+"/"+b.repo+"/events"}return d}}); \ No newline at end of file +/*! angular-github-api-factory v0.1.1 (10-12-2015) by Jonathan Hornung */ +"use strict";angular.module("jtt_github",[]).factory("githubFactory",["$http","githubSearchDataService",function(a,b){var c={};return c.getUser=function(c){var d=b.getNew("user",c);return a({method:"GET",url:d.url,params:d.object})},c.getReposByUser=function(c){var d=b.getNew("reposByUser",c);return a({method:"GET",url:d.url,params:d.object})},c.getReposByName=function(c){var d=b.getNew("reposByName",c);return a({method:"GET",url:d.url,params:d.object})},c.getRepoByUserAndName=function(c){var d=b.getNew("repoByUserAndName",c);return a({method:"GET",url:d.url,params:d.object})},c.getEventsByUser=function(c){var d=b.getNew("eventsByUser",c);return a({method:"GET",url:d.url,params:d.object})},c.getEventsFromRepoByUserAndName=function(c){var d=b.getNew("eventsFromRepoByUserAndName",c);return a({method:"GET",url:d.url,params:d.object})},c}]).service("githubSearchDataService",function(){this.getApiBaseUrl=function(a){return"https://api.github.com/"},this.fillDataInObjectByList=function(a,b,c){return angular.forEach(c,function(c,d){"undefined"!=typeof b[c]&&(a.object[c]=b[c])}),a},this.getNew=function(a,b){var c=20,d={object:{},url:""};switch(a){case"user":d.object={access_token:b.access_token},d=this.fillDataInObjectByList(d,b,[]),d.url=this.getApiBaseUrl()+"users/"+b.user;break;case"reposByUser":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["q","sort","order","page"]),d.url=this.getApiBaseUrl()+"users/"+b.user+"/repos";break;case"reposByName":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["sort","order","page"]),d.url=this.getApiBaseUrl()+"search/repositories?q="+b.q;break;case"repoByUserAndName":d.object={access_token:b.access_token},d=this.fillDataInObjectByList(d,b,[]),d.url=this.getApiBaseUrl()+"repos/"+b.user+"/"+b.repo;break;case"eventsByUser":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["q","sort","order","page"]),d.url=this.getApiBaseUrl()+"users/"+b.user+"/events";break;case"eventsFromRepoByUserAndName":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["q","sort","order","page"]),d.url=this.getApiBaseUrl()+"repos/"+b.user+"/"+b.repo+"/events"}return d}}); \ No newline at end of file diff --git a/package.json b/package.json index a600d9b..25deebc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-github-api-factory", - "version": "0.1.0", + "version": "0.1.1", "description": "angularjs factory for github json rest api requests", "main": "Gruntfile.js", "scripts": { diff --git a/src/angular-github-api-factory.js b/src/angular-github-api-factory.js index 7a9873c..03b83de 100644 --- a/src/angular-github-api-factory.js +++ b/src/angular-github-api-factory.js @@ -11,7 +11,7 @@ angular.module("jtt_github", []) var githubFactory = {}; - getRepoByUserAndNamegithubFactory.getUser = function (_params) { + githubFactory.getUser = function (_params) { var searchData = githubSearchDataService.getNew("user", _params); return $http({ method: 'GET',