Skip to content

Commit

Permalink
Change pagination ttributes type
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoria committed Jan 7, 2019
1 parent f020c76 commit c22d2cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions node/dataSources/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export class DocumentDataSource extends RESTDataSource<ServiceContext> {
{ _fields: fields }
)

public searchDocuments = (acronym: string, fields: string[], where: string, { page, pageSize }: PaginationArgs) => this.get(
public searchDocuments = (acronym: string, fields: string[], where: string, pagination: PaginationArgs) => this.get(
`${acronym}/search`,
{ _fields: fields, _where: where },
{ headers: { page, pageSize } }
{ headers: { ...pagination } }
)

public createDocument = (acronym: string, fields: string[]) => this.post(
Expand Down Expand Up @@ -50,7 +50,7 @@ export class DocumentDataSource extends RESTDataSource<ServiceContext> {
const pageSize = request.headers.get('pageSize')
const formDataHeaders = request.headers.get('formDataHeaders')
if (page && pageSize) {
request.headers = withMDPagination()(vtex, cookie)(page, pageSize)
request.headers = withMDPagination()(vtex, cookie)(+page, +pageSize)
} else if (formDataHeaders) {
request.headers = {
'Proxy-Authorization': this.context.vtex.authToken,
Expand Down

0 comments on commit c22d2cd

Please sign in to comment.