diff --git a/@salix/crud/src/client/addresses-data-edit/index.js b/@salix/crud/src/client/addresses-data-edit/index.js index 0e35bddf6..a89ecdcc4 100644 --- a/@salix/crud/src/client/addresses-data-edit/index.js +++ b/@salix/crud/src/client/addresses-data-edit/index.js @@ -8,13 +8,19 @@ export const COMPONENT = { controller: function($http, $stateParams) { this.address = {}; $http.get(`/client/api/Addresses/${$stateParams.addressId}`).then( - json => this.address = json.data + json => { + this.address = json.data; + } ); $http.get('/client/api/Agencies').then( - json => this.agencies = json.data + json => { + this.agencies = json.data; + } ); $http.get('/client/api/Provinces').then( - json => this.provinces = json.data + json => { + this.provinces = json.data; + } ); this.submit = function() { diff --git a/db.json b/db.json index 36dd6cd63..529d5023b 100644 --- a/db.json +++ b/db.json @@ -9,7 +9,7 @@ "Country": 3, "Province": 3, "Agency": 4, - "Account": 19, + "Account": 20, "ClientObservation": 1265 }, "models": { @@ -54,8 +54,7 @@ }, "Account": { "1": "{\"id\":1,\"password\":\"joselito\",\"name\":\"asdf\"}", - "12": "{\"id\":12,\"name\":\"\",\"active\":true}", - "14": "{\"id\":14,\"name\":\"us14\",\"active\":false}", + "14": "{\"id\":14,\"active\":true,\"name\":\"f\"}", "15": "{\"id\":15,\"name\":\"asdf\"}" }, "ClientObservation": { diff --git a/services/client/common/models/Address.json b/services/client/common/models/Address.json index 9a60529e5..7bd9d2ddb 100644 --- a/services/client/common/models/Address.json +++ b/services/client/common/models/Address.json @@ -1,6 +1,7 @@ { "name": "Address", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number", diff --git a/services/client/common/models/Agency.json b/services/client/common/models/Agency.json index d44a9aff4..431a07ce2 100644 --- a/services/client/common/models/Agency.json +++ b/services/client/common/models/Agency.json @@ -1,6 +1,7 @@ { "name": "Agency", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number", diff --git a/services/client/common/models/Country.json b/services/client/common/models/Country.json index 8433f109b..a0f425f55 100644 --- a/services/client/common/models/Country.json +++ b/services/client/common/models/Country.json @@ -1,6 +1,7 @@ { "name": "Country", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number", diff --git a/services/client/common/models/PaymentMethod.json b/services/client/common/models/PaymentMethod.json index 3cb5d5a29..f78548dd2 100644 --- a/services/client/common/models/PaymentMethod.json +++ b/services/client/common/models/PaymentMethod.json @@ -1,6 +1,7 @@ { "name": "PaymentMethod", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number", diff --git a/services/client/common/models/Province.json b/services/client/common/models/Province.json index 68c73d9d1..2279afc81 100644 --- a/services/client/common/models/Province.json +++ b/services/client/common/models/Province.json @@ -1,6 +1,7 @@ { "name": "Province", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number", diff --git a/services/client/common/models/SalesPerson.json b/services/client/common/models/SalesPerson.json index 76d1aa58b..be81be863 100644 --- a/services/client/common/models/SalesPerson.json +++ b/services/client/common/models/SalesPerson.json @@ -1,6 +1,7 @@ { "name": "SalesPerson", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number", diff --git a/services/client/common/models/account.json b/services/client/common/models/account.json index af3254ad9..f84e260ed 100644 --- a/services/client/common/models/account.json +++ b/services/client/common/models/account.json @@ -1,6 +1,7 @@ { "name": "Account", "base": "PersistedModel", + "validateUpsert": true, "properties": { "id": { "type": "Number",