Skip to content

Commit

Permalink
fix: use default-path as alternative default-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Oct 20, 2022
1 parent 09226cb commit 13594d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/query/parameter/fields/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function applyQueryFieldsParseOutput<T extends ObjectLiteral = ObjectLite

query.select(data.map((field) => {
const alias = getAliasForPath(options.relations, field.path) ||
options.defaultAlias;
options.defaultAlias ||
options.defaultPath;

return buildKeyWithPrefix(field.key, alias);
}));

Expand Down
3 changes: 2 additions & 1 deletion src/query/parameter/filters/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function transformParsedFilters(

for (let i = 0; i < data.length; i++) {
const alias = getAliasForPath(options.relations, data[i].path) ||
options.defaultAlias;
options.defaultAlias ||
options.defaultPath;

const fullKey : string = buildKeyWithPrefix(data[i].key, alias);

Expand Down

0 comments on commit 13594d4

Please sign in to comment.