Skip to content

Commit

Permalink
Optimistically search for resource on translatesTo table
Browse files Browse the repository at this point in the history
When translating an abstractSqlModel the passed translated model might not have been compiled yet
and not have the associated resource$alias keys. In this case, we can optimistically search for unaliased resouces that match exactly the one $toResource is translating to

Change-type: patch
  • Loading branch information
otaviojacobi committed Dec 3, 2024
1 parent b7b5d81 commit d69d86f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sbvr-api/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ export const translateAbstractSqlModel = (
fromAbstractSqlModel,
toAbstractSqlModel,
key,
aliasedToResource,
toAbstractSqlModel.tables[aliasedToResource] != null
? aliasedToResource
: unaliasedToResource,
definition,
);
}
Expand Down

0 comments on commit d69d86f

Please sign in to comment.