robsontenorio/vue-api-query

Customizing Queryparams is not working

Closed this issue · 3 comments

I would like to add few things link offset along with limit in the parameter names. But it gives some error saying that offset is not a function.

But when I print the parameter names for any model, it has all the things. But it is being ignored while building a query I guess.

  parameterNames() {
    const defaultParams = super.parameterNames()
    const customParams = {
      offset: 'offset',
    }
    return { ...defaultParams, ...customParams }
  }

This is the function that I wrote in the base Model. I think sytax and everything else is correct.

Currently I am using the latest version i.e 1.9.1

I misread it. I understand that, this is only to override the existing parameter names.

I'll close the issue. But can we add offset too as this is also one of the mostly used pagination alongside page-limit pagination. It would be nice to have this also in the list of parameter names.

Since the title is misleading if you want an enhancement, you should close this ticket and open a new one with the suggested change.

Sure. I am closing it now.