feathersjs-ecosystem / feathers-vuex

Integration of FeathersJS, Vue, and Nuxt for the artisan developer

Home Page:https://vuex.feathersjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Small error in setupInstance() documentation?

sebastien-prudhomme opened this issue · comments

I think there is this small error in setupInstance() documentation in docs/model-classes.md:

data.posts = data.posts.map(post => new models.Post(post))

should be replaces by:

data.posts = data.posts.map(post => new models.api.Post(post))

Can someone confirm?

It depends whether or not you've set up a serverAlias and if so what you've named that alias.

If you have set up a serverAlias of api then you will need to access the Post constructor at models.api.Post as you've indicated.

The default value for serverAlias is api and all other code examples use models.api.

I can read in the doc that Models are keyed by serverAlias, this is not a mandatory field in the options?

I think @sebastien-prudhomme is right on this one. I think it's a leftover.
Could you do a pull request? Highly appreciated :)

Yep, those docs are outdated. A PR would be appreciated.