From 6c9ff55f8a69fb4c51ead2743d944fccb32dd168 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:31:27 +0100 Subject: [PATCH] Check manyRelationships length (#11907) --- packages/server/src/api/controllers/row/ExternalRequest.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index e5b2a82311..064e4d1792 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -818,7 +818,10 @@ export class ExternalRequest { // can't really use response right now const response = await getDatasourceAndQuery(json) // handle many to many relationships now if we know the ID (could be auto increment) - if (operation !== Operation.READ && processed.manyRelationships) { + if ( + operation !== Operation.READ && + processed.manyRelationships?.length > 0 + ) { await this.handleManyRelationships( table._id || "", response[0],