1
0
Fork 0
mirror of synced 2024-07-03 21:40:55 +12:00

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

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,