Skip to content

Commit

Permalink
fix: added prefix check to generate valid placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
atayahmet committed Mar 15, 2021
1 parent 498859f commit 15fa557
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class RouteGroup {

private getPlaceholder() {
const namespace = this.head.split('/').pop() || '';
return `:${pluralize.singular(namespace)}Id`;
const prefix = pluralize.singular(namespace);
return `:${prefix ? `${prefix}Id` : 'id'}`;
}
}

Expand Down

0 comments on commit 15fa557

Please sign in to comment.