FiguredLimited / vue-mc

Models and Collections for Vue
https://vuemc.io
MIT License
626 stars 98 forks source link

Documentation for adding own api calls #144

Open nickngqs opened 4 years ago

nickngqs commented 4 years ago

Currently, the documentation doesn't show how to do that. It can be quite confusing, since the demo uses laravel. Since the demo is a monolithic application, I'm assuming /task means something like this ${baseURL}/task will work. So for apps that split front end and back end, does this mean I should put save: '${serverURL}/task' ?

In demo/resources/assets/models/Task.js

routes() {
    return {
        save:   '/task',
        delete: '/task/{id}',
        update: '/task/{id}'
    }
}

And how do I inject axios instance properties also? I was looking for elegant, structured way and came across vue-mc. Maybe, it's written in the documentation, but I can't seems to find it.

I think it will benefit a lot of people, if vue-mc have better documentation.

alvaro-canepa commented 4 years ago

By the way, in doc said "Expected but optional route keys are fetch, save, and delete." But sourcing the code, I found all the keys (fetch, save, update, create, patch, delete).