creado el modelo Chanel.

Se puede seleccionar en el cliente.
This commit is contained in:
nelo 2017-05-11 13:01:33 +02:00
parent 85184d71eb
commit 495e3b7c5e
5 changed files with 41 additions and 2 deletions

View File

@ -28,7 +28,13 @@
value-field="id"
label="Comercial">
</vn-autocomplete>
<vn-one></vn-one>
<vn-autocomplete vn-one
field="$ctrl.client.chanelFK"
url="/client/api/Chanels"
show-field="name"
value-field="id"
label="Canal">
</vn-autocomplete>
</vn-horizontal>
</vn-vertical>
</vn-card>

View File

@ -0,0 +1,24 @@
{
"name": "Chanel",
"base": "PersistedModel",
"validateUpsert": true,
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": true
}
},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}

View File

@ -70,7 +70,7 @@ module.exports = function(Client) {
Client.update({id: client.id}, {active: !client.active});
cb(null, !client.active);
}
})
});
};
// Basic filter

View File

@ -144,6 +144,11 @@
"type": "hasMany",
"model": "Address",
"foreignKey": "clientFk"
},
"chanelFK":{
"type": "hasOne",
"model": "Chanel",
"foreignKey": "chanelFK"
}
},
"acls": [

View File

@ -69,5 +69,9 @@
"Account": {
"dataSource": "vn",
"public": true
},
"Chanel": {
"dataSource": "vn",
"public": true
}
}