From a7cd637087a6aa4f91bfbafecb2dc3e2490585d3 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 25 Jun 2020 20:35:03 +0100 Subject: [PATCH] linked records matched up by name --- packages/server/src/api/controllers/model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/model.js b/packages/server/src/api/controllers/model.js index 6fba9f998a..79c285d784 100644 --- a/packages/server/src/api/controllers/model.js +++ b/packages/server/src/api/controllers/model.js @@ -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,