Skip to content

Commit

Permalink
fix: allow subjectIdOrSet to be a function in relation query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Oct 8, 2024
1 parent 258a6a1 commit 4864c5a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ export function createRelationQuery<
},
(v) => v === undefined || v === null
) as unknown as RelationQuery['subject_set'];
} else if (typeof subjectIdOrSet === 'string') {
} else if (
typeof subjectIdOrSet === 'string' ||
typeof subjectIdOrSet === 'function'
) {
result.subject_id =
resolveTupleProperty('subjectIdOrSet', tuple, replacements) ?? '';
}
Expand Down Expand Up @@ -133,7 +136,10 @@ export function createFlattenRelationQuery<
result.subjectSetRelation =
resolveTupleProperty('subjectIdOrSet.relation', tuple, replacements) ??
'';
} else if (typeof subjectIdOrSet === 'string') {
} else if (
typeof subjectIdOrSet === 'string' ||
typeof subjectIdOrSet === 'function'
) {
result.subjectId =
resolveTupleProperty('subjectIdOrSet', tuple, replacements) ?? '';
}
Expand Down

0 comments on commit 4864c5a

Please sign in to comment.