Skip to content

Commit

Permalink
Fix relation processing for lists
Browse files Browse the repository at this point in the history
  • Loading branch information
s1owjke committed Dec 11, 2024
1 parent 73681fe commit 42434f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prisma-rls",
"version": "0.4.2",
"version": "0.4.3",
"description": "Prisma client extension for row-level security on any database",
"license": "MIT",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export class ModelResolver {
for (const relationMetadata of relationsMetadata) {
switch (relationMetadata.type) {
case "requiredBelongsTo":
const matchingRelations = pickByPath(result, Array.isArray(result) ? relationMetadata.path.replace("$.", "$.*.") : relationMetadata.path);
const matchingRelations = pickByPath(result, relationMetadata.path);
if (!matchingRelations.length) {
continue;
}
Expand Down

0 comments on commit 42434f1

Please sign in to comment.