bug fixed in edit addresses

This commit is contained in:
Daniel Herrero 2017-11-15 12:11:35 +01:00
parent bb4c43c2bd
commit d4a0cf205d
3 changed files with 10 additions and 3 deletions

View File

@ -36,7 +36,7 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
initial-data="$ctrl.address.defaultAgencyFk"
initial-data="$ctrl.address.defaultAgency"
field="$ctrl.address.defaultAgencyFk"
url="/client/api/AgencyModes"
show-field="name"

View File

@ -25,12 +25,19 @@ module.exports = function(Self) {
Self.beforeRemote('findById', function(ctx, modelInstance, next) {
ctx.args.filter = {
include: {
include: [{
relation: "province",
scope: {
fields: ["id", "name"]
}
},
{
relation: "defaultAgency",
scope: {
fields: ["id", "name"]
}
}
]
};
next();
});

View File

@ -58,7 +58,7 @@
},
"defaultAgency": {
"type": "belongsTo",
"model": "Agency",
"model": "AgencyMode",
"foreignKey": "defaultAgencyFk"
}
}