zooniverse / json-api-client

Apache License 2.0
10 stars 5 forks source link

Add API methods to ResourcePromise #84

Closed eatyourgreens closed 1 year ago

eatyourgreens commented 1 year ago

Remove the code that dynamically assigned Resource methods to ResourcePromise. Add a generic ResourcePromise.prototype.api method, and the following wrapper methods:

This should fix API client errors where a resource, or set of resources, can't be fetched or modified by chaining client.type().get(). See https://github.com/zooniverse/Panoptes-Front-End/issues/6381 and https://github.com/zooniverse/Panoptes-Front-End/issues/6380.