Closed crcatala closed 6 years ago
When idFrom is set to 'ARGS', api methods that don't require arguments ends up throwing errors.
idFrom
'ARGS'
For example:
getList.operation = 'READ'; getList.idFrom = 'ARGS'; function getList() { const url = `${BASE_URL}search?query=react&hitsPerPage=200`; return fetch(url) .then(response => response.json()) .then(result => result.hits); } api.hackernews.getList().then(hits => this.list = hits);
Calling getList() throws:
getList()
Error: Value is missing id, tried to add to entity products
Interestingly, passing any arg (even though not used by the api method) will make the call work as intended. i.e api.hackernews.getList('hello').then(hits => this.list = hits)
api.hackernews.getList('hello').then(hits => this.list = hits)
When
idFrom
is set to'ARGS'
, api methods that don't require arguments ends up throwing errors.For example:
Calling
getList()
throws:Interestingly, passing any arg (even though not used by the api method) will make the call work as intended. i.e
api.hackernews.getList('hello').then(hits => this.list = hits)