@sgftech/medusa-plugin-marketplace-v2 0.1.93 → 0.1.94
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.
|
@@ -38,15 +38,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.GET = void 0;
|
|
40
40
|
function GET(req, res, next) {
|
|
41
|
+
var _a;
|
|
41
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
43
|
var result, tag, skip, take, productService;
|
|
43
|
-
return __generator(this, function (
|
|
44
|
-
switch (
|
|
44
|
+
return __generator(this, function (_b) {
|
|
45
|
+
switch (_b.label) {
|
|
45
46
|
case 0:
|
|
46
47
|
if (!req.query.tag) return [3 /*break*/, 2];
|
|
47
|
-
tag = req.query.tag;
|
|
48
|
-
skip =
|
|
49
|
-
take =
|
|
48
|
+
tag = decodeURIComponent((_a = req.query.tag) !== null && _a !== void 0 ? _a : "");
|
|
49
|
+
skip = 0;
|
|
50
|
+
take = 20;
|
|
50
51
|
if (req.query.skip)
|
|
51
52
|
skip = parseInt(req.query.skip);
|
|
52
53
|
if (req.query.limit)
|
|
@@ -54,11 +55,11 @@ function GET(req, res, next) {
|
|
|
54
55
|
productService = req.scope.resolve("productService");
|
|
55
56
|
return [4 /*yield*/, productService.retrieveByTag(tag, skip, take)];
|
|
56
57
|
case 1:
|
|
57
|
-
result =
|
|
58
|
-
_a.label = 2;
|
|
59
|
-
case 2:
|
|
58
|
+
result = _b.sent();
|
|
60
59
|
res.send(result);
|
|
61
|
-
return [
|
|
60
|
+
return [3 /*break*/, 3];
|
|
61
|
+
case 2: throw new Error("tag not specified");
|
|
62
|
+
case 3: return [2 /*return*/];
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
65
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/api/store/list-products/route.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAsB,GAAG,CACrB,GAAkB,EAClB,GAAmB,EACnB,IAAwB
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/api/store/list-products/route.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAsB,GAAG,CACrB,GAAkB,EAClB,GAAmB,EACnB,IAAwB;;;;;;;yBAGpB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAb,wBAAa;oBACP,GAAG,GAAG,kBAAkB,CAAC,MAAC,GAAG,CAAC,KAAK,CAAC,GAAc,mCAAI,EAAE,CAAC,CAAC;oBAE5D,IAAI,GAAG,CAAC,CAAC;oBACT,IAAI,GAAG,EAAE,CAAC;oBACd,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI;wBAAE,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAc,CAAC,CAAC;oBAC9D,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK;wBAAE,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC;oBAE1D,cAAc,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CACpC,gBAAgB,CACD,CAAC;oBACX,qBAAM,cAAc,CAAC,aAAa,CAAC,GAAa,EAAE,IAAI,EAAE,IAAI,CAAC,EAAA;;oBAAtE,MAAM,GAAG,SAA6D,CAAC;oBACvE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;wBACd,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;wBAE5C,sBAAO;;;;CACV;AAtBD,kBAsBC"}
|