1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

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

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