From 7c9d0594f8e37c1cbd102ccf86ae8c0abd9c3faf Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 18:30:17 +0100 Subject: [PATCH] Fixing #6980 - fixing choice of relational foreign key field name when working with fields named differently to the primary key. --- packages/server/src/api/controllers/row/ExternalRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index a1aecdb0f2..dd5778b9d9 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -534,7 +534,7 @@ module External { }) // this is the response from knex if no rows found 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 } } return related