Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion data/getter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export default class Getter {
return this;
};

withOffset = (offset) => {
this.offset = offset;
return this;
};

extendAdditionals = (prop) => {
this.additionals = [...this.additionals, prop];
return this;
Expand All @@ -32,7 +37,7 @@ export default class Getter {
);
}

return this.objectsPath.buildGet(this.className, this.limit, this.additionals)
return this.objectsPath.buildGet(this.className, this.limit, this.offset, this.additionals)
.then(this.client.get);
};
}
1 change: 1 addition & 0 deletions data/journey.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ describe("data", () => {
.withAdditional("nearestNeighbors")
.withAdditional("featureProjection")
.withVector()
.withOffset(2)
.withLimit(2)
.do()
.then((res) => {
Expand Down
7 changes: 5 additions & 2 deletions data/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export class ObjectsPath {
buildGetOne(id, className, additionals) {
return this.build({id, className, additionals}, [this.addClassNameDeprecatedNotSupportedCheck, this.addId, this.addQueryParams]);
}
buildGet(className, limit, additionals) {
return this.build({className, limit, additionals}, [this.addQueryParamsForGet]);
buildGet(className, limit, offset, additionals) {
return this.build({className, limit, offset, additionals}, [this.addQueryParamsForGet]);
}
buildUpdate(id, className) {
return this.build({id, className}, [this.addClassNameDeprecatedCheck, this.addId]);
Expand Down Expand Up @@ -86,6 +86,9 @@ export class ObjectsPath {
if (typeof params.limit == "number" && params.limit > 0) {
queryParams.push(`limit=${params.limit}`);
}
if (typeof params.offset == "number" && params.offset > 0) {
queryParams.push(`offset=${params.offset}`);
}
if (isValidStringProperty(params.className)) {
if (support.supports) {
queryParams.push(`class=${params.className}`);
Expand Down