bug fixed in edit addresses
This commit is contained in:
parent
bb4c43c2bd
commit
d4a0cf205d
|
@ -36,7 +36,7 @@
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete vn-one
|
||||||
initial-data="$ctrl.address.defaultAgencyFk"
|
initial-data="$ctrl.address.defaultAgency"
|
||||||
field="$ctrl.address.defaultAgencyFk"
|
field="$ctrl.address.defaultAgencyFk"
|
||||||
url="/client/api/AgencyModes"
|
url="/client/api/AgencyModes"
|
||||||
show-field="name"
|
show-field="name"
|
||||||
|
|
|
@ -25,12 +25,19 @@ module.exports = function(Self) {
|
||||||
|
|
||||||
Self.beforeRemote('findById', function(ctx, modelInstance, next) {
|
Self.beforeRemote('findById', function(ctx, modelInstance, next) {
|
||||||
ctx.args.filter = {
|
ctx.args.filter = {
|
||||||
include: {
|
include: [{
|
||||||
relation: "province",
|
relation: "province",
|
||||||
scope: {
|
scope: {
|
||||||
fields: ["id", "name"]
|
fields: ["id", "name"]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: "defaultAgency",
|
||||||
|
scope: {
|
||||||
|
fields: ["id", "name"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
},
|
},
|
||||||
"defaultAgency": {
|
"defaultAgency": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Agency",
|
"model": "AgencyMode",
|
||||||
"foreignKey": "defaultAgencyFk"
|
"foreignKey": "defaultAgencyFk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue