When you have already defined a schema on a collection and you refence this in links, there's no need to extend the schema. Just use the current schema

This commit is contained in:
jens 2017-02-22 17:52:53 +01:00
parent 5b4693343f
commit 2500c1a171

View file

@ -266,9 +266,11 @@ export default class Linker {
if (this.mainCollection.simpleSchema && this.mainCollection.simpleSchema()) {
const schema = createFieldSchema(this.isMany(), this.linkConfig.metadata);
this.mainCollection.attachSchema({
[this.linkConfig.field]: schema
});
if(! this.mainCollection.simpleSchema()._schemaKeys.includes(this.linkConfig.field)) {
this.mainCollection.attachSchema({
[this.linkConfig.field]: schema
});
}
}
}
@ -378,4 +380,4 @@ export default class Linker {
})
}
}
}
}