Back to Top

Ad-Hoc-Frontend-Homework master

Homework using modern JS tooling (ES6/flow)

transformResponse()

The response transformed from the /records endpoint

Properties

Name Type Description
ids Array.<number>
  • An array containing the ids of all items returned from the request.
open Array.<Record>
  • An array containing all of the items returned from the request that have a disposition value of "open".
closedPrimaryCount number
  • The total number of items returned from the request that have a disposition value of "closed" and contain a primary color.
previousPage number
  • The page number for the previous page of results, or null if this is the first page.
nextPage number
  • The page number for the next page of results, or null if this is the last page.

Returns

Void

retrieve(options)

Transforms the fetched payload from the records endpoint into a single response

Parameters

Name Type Description
options RetrieveOptions
  • The options to pass to the records api

Returns

Promise.<TransformedResponse>

Returns the transformed response (as a promise)