Closed puckey closed 4 years ago
The hello action in the front/dummies controller is expecting an instance of the Dummy model as its first argument:
front/dummies
Dummy
@action('get') @parameters({ name: 'msg', type: 'string', required: true }) @returns({ name: 'greeting', type: 'string' }) hello(dummy, msg) { return `Hello ${dummy.fullName}: ${msg}` }
But instead it receives the koa context as its first argument, causing this.fullName to be undefined.
this.fullName
undefined
http://0.0.0.0:8080/api/front/dummies/1/hello?msg=Just+saying+hello
This issue is fixed by the following pr: https://github.com/ditojs/dito-example/pull/8
The hello action in the
front/dummies
controller is expecting an instance of theDummy
model as its first argument:But instead it receives the koa context as its first argument, causing
this.fullName
to beundefined
.http://0.0.0.0:8080/api/front/dummies/1/hello?msg=Just+saying+hello