JS: Fix scrutinizer warnings and indentation for services
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
9014ae1490
commit
320f2bf5c8
@@ -20,6 +20,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: oc_defaults */
|
||||||
app.factory('ApiService', function ($http, $q) {
|
app.factory('ApiService', function ($http, $q) {
|
||||||
var ApiService = function (http, endpoint) {
|
var ApiService = function (http, endpoint) {
|
||||||
this.endpoint = endpoint;
|
this.endpoint = endpoint;
|
||||||
@@ -57,7 +58,7 @@ app.factory('ApiService', function($http, $q){
|
|||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
$http.get(this.baseUrl + '/' + id).then(function (response) {
|
$http.get(this.baseUrl + '/' + id).then(function (response) {
|
||||||
data = response.data;
|
var data = response.data;
|
||||||
if (self.data[data.id] === undefined) {
|
if (self.data[data.id] === undefined) {
|
||||||
self.data[data.id] = response.data;
|
self.data[data.id] = response.data;
|
||||||
}
|
}
|
||||||
@@ -149,7 +150,6 @@ app.factory('ApiService', function($http, $q){
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ApiService.prototype.getData = function () {
|
ApiService.prototype.getData = function () {
|
||||||
return $.map(this.data, function (value, index) {
|
return $.map(this.data, function (value, index) {
|
||||||
return [value];
|
return [value];
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: OC */
|
||||||
app.factory('BoardService', function (ApiService, $http, $q) {
|
app.factory('BoardService', function (ApiService, $http, $q) {
|
||||||
var BoardService = function ($http, ep, $q) {
|
var BoardService = function ($http, ep, $q) {
|
||||||
ApiService.call(this, $http, ep, $q);
|
ApiService.call(this, $http, ep, $q);
|
||||||
@@ -215,7 +216,6 @@ app.factory('BoardService', function(ApiService, $http, $q){
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
service = new BoardService($http, 'boards', $q);
|
return new BoardService($http, 'boards', $q);
|
||||||
return service;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,6 +25,5 @@ app.factory('LabelService', function(ApiService, $http, $q){
|
|||||||
ApiService.call(this, $http, ep, $q);
|
ApiService.call(this, $http, ep, $q);
|
||||||
};
|
};
|
||||||
LabelService.prototype = angular.copy(ApiService.prototype);
|
LabelService.prototype = angular.copy(ApiService.prototype);
|
||||||
service = new LabelService($http, 'labels', $q);
|
return new LabelService($http, 'labels', $q);
|
||||||
return service;
|
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user