Skip to content

Commit

Permalink
fix search_after
Browse files Browse the repository at this point in the history
  • Loading branch information
jensdev committed Mar 8, 2021
1 parent 6bfcd1e commit f4b513d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.2] - 2021-03-08

### Changed

- getting all assets was not correctly getting the next page

## [1.0.1] - 2021-03-05

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@craftzing/akeneo-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "A Node Rest Client for the Akeneo PIM",
"author": "Jens Verbeken <[email protected]>",
"license": "MIT",
Expand Down
7 changes: 5 additions & 2 deletions src/endpoints/raw.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-underscore-dangle */
import { AxiosInstance, AxiosRequestConfig } from 'axios';
import { last } from 'ramda';
import qs from 'qs';
import errorHandler from '../error-handler';
import { ListResponse } from '../types';

Expand Down Expand Up @@ -98,7 +98,10 @@ export default {
params: {
...params,
limit: params?.limit || 100,
search_after: last(items).code,
search_after:
_links?.next?.href && _links?.next?.href.split('?')[1]
? qs.parse(_links?.next?.href.split('?')[1]).search_after
: '',
},
})
).items,
Expand Down

0 comments on commit f4b513d

Please sign in to comment.