Skip to content

Commit

Permalink
Fixed more lint warnings. Repo check mappings whether to get validati…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
wwelling committed Apr 24, 2017
1 parent 52ee1d1 commit 47a8f64
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions app/repo/abstractRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {

var listenCallbacks = [];

var validations = ValidationStore.getValidations(modelName);
var validations = {};

if (abstractRepo.mapping.validations) {
validations = ValidationStore.getValidations(modelName);
}

$rootScope.$on("$locationChangeSuccess", function () {
listenCallbacks.length = 0;
Expand Down Expand Up @@ -135,7 +139,7 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
abstractRepo.clearValidationResults();
var promise = model.delete();
promise.then(function (res) {
if (angular.fromJson(res.body).meta.type == "INVALID") {
if (angular.fromJson(res.body).meta.type === "INVALID") {
angular.extend(abstractRepo, angular.fromJson(res.body).payload);
}
});
Expand All @@ -146,7 +150,7 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
abstractRepo.clearValidationResults();
var promise = abstractRepo.findById(id).delete();
promise.then(function (res) {
if (angular.fromJson(res.body).meta.type == "INVALID") {
if (angular.fromJson(res.body).meta.type === "INVALID") {
angular.extend(abstractRepo, angular.fromJson(res.body).payload);
}
});
Expand All @@ -160,7 +164,7 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
});
var promise = WsApi.fetch(abstractRepo.mapping.create);
promise.then(function (res) {
if (angular.fromJson(res.body).meta.type == "INVALID") {
if (angular.fromJson(res.body).meta.type === "INVALID") {
angular.extend(abstractRepo, angular.fromJson(res.body).payload);
}
});
Expand All @@ -172,7 +176,7 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
abstractRepo.clearValidationResults();
var promise = model.save();
promise.then(function (res) {
if (angular.fromJson(res.body).meta.type == "INVALID") {
if (angular.fromJson(res.body).meta.type === "INVALID") {
angular.extend(abstractRepo, angular.fromJson(res.body).payload);
}
});
Expand All @@ -193,7 +197,7 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
});
var promise = WsApi.fetch(abstractRepo.mapping.sort);
promise.then(function (res) {
if (angular.fromJson(res.body).meta.type == "INVALID") {
if (angular.fromJson(res.body).meta.type === "INVALID") {
angular.extend(abstractRepo, angular.fromJson(res.body).payload);
console.log(abstractRepo);
}
Expand All @@ -208,9 +212,8 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
});
var promise = WsApi.fetch(abstractRepo.mapping.reorder);
promise.then(function (res) {
if (angular.fromJson(res.body).meta.type == "INVALID") {
if (angular.fromJson(res.body).meta.type === "INVALID") {
angular.extend(abstractRepo, angular.fromJson(res.body).payload);
console.log(abstractRepo);
}
});
return promise;
Expand Down

0 comments on commit 47a8f64

Please sign in to comment.