I am working with json-server and I am getting following error. What I am doing wrong?
TypeError: Cannot read property 'id' of undefined [0] at Function.createId (/Users/Picchu/Documents/url/node_modules/json-server/lib/server/mixins.js:47:39) [0] at Function.insert (/Users/Picchu/Documents/url/node_modules/lodash-id/src/index.js:47:49) [0] at /Users/Picchu/Documents/url/node_modules/lodash/lodash.js:4388:28 [0] at arrayReduce (/Users/Picchu/Documents/url/node_modules/lodash/lodash.js:683:21) [0] at baseWrapperValue (/Users/Picchu/Documents/url/node_modules/lodash/lodash.js:4387:14)
createShortUrl(data: ShortUrl): Observable<any> {
let params = new HttpParams();
params = params.append('url', 'http://google.com');
return this._http.post(`${'/api'}`, { params: params }).pipe(map((res) => {
return res;
}