diff --git a/packages/cli/generators/relation/templates/controller-relation-template-belongs-to.ts.ejs b/packages/cli/generators/relation/templates/controller-relation-template-belongs-to.ts.ejs index 10062a3ec406..11135b03224b 100644 --- a/packages/cli/generators/relation/templates/controller-relation-template-belongs-to.ts.ejs +++ b/packages/cli/generators/relation/templates/controller-relation-template-belongs-to.ts.ejs @@ -33,6 +33,6 @@ export class <%= controllerClassName %> { async get<%= targetModelClassName %>( @param.path.<%= sourceModelPrimaryKeyType %>('id') id: typeof <%= sourceModelClassName %>.prototype.<%= sourceModelPrimaryKey %>, ): Promise<<%= targetModelClassName %>> { - return this.<%= paramSourceRepository %>.<%= paramTargetModel %>(id); + return this.<%= paramSourceRepository %>.<%= relationPropertyName %>(id); } } diff --git a/packages/cli/snapshots/integration/generators/relation.belongs-to.integration.snapshots.js b/packages/cli/snapshots/integration/generators/relation.belongs-to.integration.snapshots.js index 83f6f9c68d72..5349474fbc27 100644 --- a/packages/cli/snapshots/integration/generators/relation.belongs-to.integration.snapshots.js +++ b/packages/cli/snapshots/integration/generators/relation.belongs-to.integration.snapshots.js @@ -167,7 +167,7 @@ export class OrderClassCustomerClassController { async getCustomerClass( @param.path.number('id') id: typeof OrderClass.prototype.orderNumber, ): Promise { - return this.orderClassRepository.customerClass(id); + return this.orderClassRepository.my_customer(id); } }