Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit e7ec45e

Browse files
committed
Remove pagination until we decide on how to handle that.
1 parent 9b1ce42 commit e7ec45e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/open-api/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const queryString = require('qs')
44
const fetch = require('node-fetch')
55
const Headers = fetch.Headers
66
const camelCase = require('lodash.camelcase')
7-
const { JSONHTTPError, TextHTTPError, HTTPError, getPagination } = require('micro-api-client')
7+
const { JSONHTTPError, TextHTTPError, HTTPError } = require('micro-api-client')
88

99
function existy(val) {
1010
return val != null
@@ -81,6 +81,7 @@ exports.generateMethod = method => {
8181

8282
// TODO: Use micro-api-client when it supports node-fetch
8383
const response = await fetch(path, opts)
84+
8485
const contentType = response.headers.get('Content-Type')
8586

8687
if (contentType && contentType.match(/json/)) {
@@ -89,8 +90,10 @@ exports.generateMethod = method => {
8990
if (!response.ok) {
9091
throw new JSONHTTPError(response, json)
9192
}
92-
const pagination = getPagination(response)
93-
return pagination ? { pagination, items: json } : json
93+
// TODO: Support pagination
94+
// const pagination = getPagination(response)
95+
// return pagination ? { pagination, items: json } : json
96+
return json
9497
} catch (e) {
9598
throw new HTTPError(response)
9699
}

0 commit comments

Comments
 (0)