Fixing #6980 - fixing choice of relational foreign key field name when working with fields named differently to the primary key.

This commit is contained in:
mike12345567 2022-09-07 18:30:17 +01:00
parent 8e56a7a4d9
commit 7c9d0594f8
1 changed files with 1 additions and 1 deletions

View File

@ -534,7 +534,7 @@ module External {
}) })
// this is the response from knex if no rows found // this is the response from knex if no rows found
const rows = !response[0].read ? response : [] const rows = !response[0].read ? response : []
const storeTo = isMany ? field.throughFrom || linkPrimaryKey : manyKey const storeTo = isMany ? field.throughFrom || linkPrimaryKey : fieldName
related[storeTo] = { rows, isMany, tableId } related[storeTo] = { rows, isMany, tableId }
} }
return related return related