I am a little bit confused about the workflow of how everything communicates with each other. As far as i understand axios converts post data automatically into json-string. so i have to decode it on the api side? There is no other way to do this? my goal is to keep everything as simple and easy as possible. But for the moment this seems how apis works. So i have to do this with my mock too, right?
mock.onPost(endpoint).reply((request: AxiosRequestConfig) => {
const data = <RequestParams>JSON.parse(request.data)
Again: Is there no better way as always repeat these line of json decoding? For Instance:
I am a little bit confused about the workflow of how everything communicates with each other. As far as i understand axios converts post data automatically into json-string. so i have to decode it on the api side? There is no other way to do this? my goal is to keep everything as simple and easy as possible. But for the moment this seems how apis works. So i have to do this with my mock too, right?
Again: Is there no better way as always repeat these line of json decoding? For Instance:
RequestParams is an interface
I tried to use interceptors, but this would be wrong anyways