Check manyRelationships length (#11907)

This commit is contained in:
melohagan 2023-09-27 13:31:27 +01:00 committed by GitHub
parent 60c1922a37
commit 6c9ff55f8a
1 changed files with 4 additions and 1 deletions

View File

@ -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],