linked records matched up by name

This commit is contained in:
Martin McKeaveney 2020-06-25 20:35:03 +01:00
parent 28c5756047
commit a7cd637087
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ exports.save = async function(ctx) {
if (schema[key].type === "link") {
// create the link field in the other model
const linkedModel = await db.get(schema[key].modelId)
linkedModel.schema[modelToSave._id] = {
linkedModel.schema[modelToSave.name] = {
name: modelToSave.name,
type: "link",
modelId: modelToSave._id,