devour-js / devour-client

Don't just consume your JSON API, Devour it...
https://www.npmjs.com/package/devour-client
ISC License
429 stars 90 forks source link

Resolves #250 Added a means to disable errors for missing resource definitions. #251

Closed ibustosatlegalzoom closed 1 year ago

ibustosatlegalzoom commented 1 year ago

Screenshot

N/A

What Changed & Why

Introduced a flag disableErrorsForMissingResourceDefinitions to effectively disable the error 'API resource definition for model "XWY" not found'. Instead of throwing the error though, we are invoking the Logger's error method to let users know they should fix it.

Since invokers of the modelFor method expect a model, we are returning an empty model structure which has proved effective in our tests.

Testing

Just run the tests.

Documentation

Updated the README file with instructions.