My org returns the same object for any api.
This is a wrapper around the actual normal response you would expect from a restful api e.g. api/products returns MyOrgResponse object which might look like
{true, products[], notifications[] }
and api/products/123 returns
{true, product123, notifications[] }
This breaks the angular-in-memory-web-api as it expects a restful collection to access eg.
{products} or {product123}
I can extend the service and intercept the get(reqInfo: RequestInfo) {} method. Here I can repoint to the collection its looking for (if my api/products/123 was invoked for example). I then reconstruct the body to return a MyOrgObject.
The first bit works but any ideas on how I rebuild the body/response object as my subscription is blowing up saying
"TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable" ...
I am doing this to reconstruct
body: {"operationSucceeded": true, "data": product, "notifications": []}
thanks
responseInterceptor(res: ResponseOptions, ri: RequestInfo): ResponseOptions {}in api-mock-service, do your restructuring hereapi/products/123is a url forin-memoryright? What is returning this type of data:{true, product123, notifications[] }