@labdigital/commercetools-mock 2.21.1 → 2.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/services/abstract.ts +17 -4
package/dist/index.cjs
CHANGED
|
@@ -7104,12 +7104,21 @@ var AbstractService = class {
|
|
|
7104
7104
|
get(request, response) {
|
|
7105
7105
|
const limit = this._parseParam(request.query.limit);
|
|
7106
7106
|
const offset = this._parseParam(request.query.offset);
|
|
7107
|
-
const
|
|
7107
|
+
const params = {
|
|
7108
7108
|
expand: this._parseParam(request.query.expand),
|
|
7109
7109
|
where: this._parseParam(request.query.where),
|
|
7110
7110
|
limit: limit !== void 0 ? Number(limit) : void 0,
|
|
7111
7111
|
offset: offset !== void 0 ? Number(offset) : void 0
|
|
7112
|
-
}
|
|
7112
|
+
};
|
|
7113
|
+
for (const key in request.query) {
|
|
7114
|
+
if (key.startsWith("var.")) {
|
|
7115
|
+
const items = this._parseParam(request.query[key]);
|
|
7116
|
+
if (items) {
|
|
7117
|
+
params[key] = items.length === 1 ? items[0] : items;
|
|
7118
|
+
}
|
|
7119
|
+
}
|
|
7120
|
+
}
|
|
7121
|
+
const result = this.repository.query(getRepositoryContext(request), params);
|
|
7113
7122
|
return response.status(200).send(result);
|
|
7114
7123
|
}
|
|
7115
7124
|
getWithId(request, response) {
|