ditojs / dito-example

4 stars 2 forks source link

hello example action broken #6

Closed puckey closed 4 years ago

puckey commented 4 years ago

The hello action in the front/dummies controller is expecting an instance of the Dummy model as its first argument:

    @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.

http://0.0.0.0:8080/api/front/dummies/1/hello?msg=Just+saying+hello

puckey commented 4 years ago

This issue is fixed by the following pr: https://github.com/ditojs/dito-example/pull/8