Fix codacy warnings

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-06-14 11:54:38 +02:00
parent 22190b90cf
commit 06ea03689b
5 changed files with 8 additions and 6 deletions

View File

@@ -125,7 +125,7 @@ app.factory('ApiService', function ($http, $q) {
this.data[entity.id] = entity;
} else {
Object.keys(entity).forEach(function (key) {
if (entity[key] !== null) {
if (entity[key] !== null && element[key] !== entity[key]) {
element[key] = entity[key];
}
});

View File

@@ -22,6 +22,7 @@
import app from '../app/App.js';
/* global OC oc_requesttoken */
export default class FileService {
constructor ($http, FileUploader, CardService) {
@@ -51,7 +52,7 @@ export default class FileService {
};
this.uploader.uploadItem(fileItem);
};
}
onAfterAddingFile (fileItem) {
// Fetch card details before trying to upload so we can detect filename collisions properly
@@ -87,11 +88,11 @@ export default class FileService {
});
};
}
onSuccessItem(item, response) {
let attachments = this.cardservice.get(item.cardId).attachments;
let index = attachments.indexOf(attachments.find(attachment => attachment.id === response.id));
let index = attachments.indexOf(attachments.find((attachment) => attachment.id === response.id));
if (~index) {
attachments = attachments.splice(index, 1);
}

View File

@@ -21,6 +21,7 @@
*/
import app from '../app/App.js';
/* global app angular */
app.factory('StackService', function (ApiService, CardService, $http, $q) {
var StackService = function ($http, ep, $q) {
ApiService.call(this, $http, ep, $q);