christianmalek / vuex-rest-api

A utility to simplify the use of REST APIs with Vuex
http://vuex-rest-api.org
MIT License
382 stars 48 forks source link

Allow all HTTP request methods to set a payload. #103

Closed dries007 closed 4 years ago

dries007 commented 4 years ago

The HTTP standard allows for payloads in non POST/PUT/PATH requests, and so does Axios. Axios does require it to be passed via the config instead of as the second parameter, see axios/axios#897 and the relevant docs. To make things simpler I put everything into a config object and pass that to the request call instead of using the method aliases.

This was written in the GitHub editor, and it's my frist time writing typescript, so please advise if I'm doing something wrong.

This change will allow me to fully use this library. For now I have hack around this with some ugly direct state manipulation.

christianmalek commented 4 years ago

Hey,

this looks fine to me. Thanks for the PR! I'll merge it this weekend.

christianmalek commented 4 years ago

I am currently in the middle of creating tests and integrating your changes. Unfortunately, I'm not done with that yet. I hope to have it ready by the end of the week. Sorry for the delay!

dries007 commented 4 years ago

@christianmalek That's unfortunate, but thanks for the quick response & keeping me up to date anyway :)

christianmalek commented 4 years ago

@dries007 I've changed my mind. Your PR is up. It's in version 2.13.0. You're credited here: https://github.com/christianmalek/vuex-rest-api/blob/v2/CHANGELOG.md