From 418cff98c165b0b013ff4b155c3792dd1806d901 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Tue, 19 May 2020 22:04:56 +0200 Subject: [PATCH] fix: use correct relation name in belongsTo template --- .../templates/controller-relation-template-belongs-to.ts.ejs | 2 +- .../generators/relation.belongs-to.integration.snapshots.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); } }