sul-dlss / folio_client

Interface for interacting with the Folio ILS API.
Other
0 stars 0 forks source link

Refactor use of TokenWrapper #24

Closed justinlittman closed 1 year ago

justinlittman commented 1 year ago

Currently, TokenWrapper wraps higher level operations. For example:

TokenWrapper.refresh(config, connection) do
      inventory = Inventory.new(self)
      inventory.has_instance_status?(...)
    end

This is fine for higher level operations that perform GETs, especially single GETs. However, this will be problematic for higher level operations that perform multiple POSTs, PUTs, or DELETEs, as it might result in them being repeated even when they succeeded.

For this ticket, refactor the use of TokenWrapper so that the lower level methods (FolioClient.get, FolioClient.post) are wrapped.