From 9a80e487dd43d2542952f0ce6bb6a103cbb64ffd Mon Sep 17 00:00:00 2001 From: NeuralFlux <40491005+NeuralFlux@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:50:18 -0400 Subject: [PATCH] fix: add association qualifiers only to non-TRAPI resources while reversing records --- src/record.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/record.ts b/src/record.ts index 7d29294..f168dce 100644 --- a/src/record.ts +++ b/src/record.ts @@ -180,6 +180,13 @@ export class Record { frozen.association.predicate, ); reversedAPIEdge.predicate = predicate; + + // we need association qualifiers for non-TRAPI resources only + if (this.association.smartapi.meta.has_metakg) { + // use `has_metakg` as a filter for TRAPI resources + reversedAPIEdge.qualifiers = this.qualifiers; + } + if (reversedAPIEdge.qualifiers) { const reversedQualifiers = Object.fromEntries( Object.entries(reversedAPIEdge.qualifiers).map(