add jsdoc and fix add data to referencesMany.add
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
This commit is contained in:
parent
565b85555c
commit
86045d4792
|
@ -918,6 +918,7 @@ HasManyThrough.prototype.create = function create(data, done) {
|
||||||
/**
|
/**
|
||||||
* Add the target model instance to the 'hasMany' relation
|
* Add the target model instance to the 'hasMany' relation
|
||||||
* @param {Object|ID} acInst The actual instance or id value
|
* @param {Object|ID} acInst The actual instance or id value
|
||||||
|
* @param {Object} [data] Optional data object for the through model to be created
|
||||||
*/
|
*/
|
||||||
HasManyThrough.prototype.add = function (acInst, data, done) {
|
HasManyThrough.prototype.add = function (acInst, data, done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -2553,12 +2554,17 @@ ReferencesMany.prototype.build = function(targetModelData) {
|
||||||
* Add the target model instance to the 'embedsMany' relation
|
* Add the target model instance to the 'embedsMany' relation
|
||||||
* @param {Object|ID} acInst The actual instance or id value
|
* @param {Object|ID} acInst The actual instance or id value
|
||||||
*/
|
*/
|
||||||
ReferencesMany.prototype.add = function (acInst, cb) {
|
ReferencesMany.prototype.add = function (acInst, data, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var definition = this.definition;
|
var definition = this.definition;
|
||||||
var modelTo = this.definition.modelTo;
|
var modelTo = this.definition.modelTo;
|
||||||
var modelInstance = this.modelInstance;
|
var modelInstance = this.modelInstance;
|
||||||
|
|
||||||
|
if (typeof data === 'function') {
|
||||||
|
cb = data;
|
||||||
|
data = {};
|
||||||
|
}
|
||||||
|
|
||||||
var pk = this.definition.keyTo;
|
var pk = this.definition.keyTo;
|
||||||
var fk = this.definition.keyFrom;
|
var fk = this.definition.keyFrom;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue