@mjhls/mjh-framework 1.0.1021 → 1.0.1022
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.
|
@@ -163,41 +163,43 @@ TaxonomyDescription.getDescription = function () {
|
|
|
163
163
|
var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2() {
|
|
164
164
|
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
165
165
|
var client = arguments[1];
|
|
166
|
-
var
|
|
166
|
+
var parent_id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
167
|
+
var parent_query, query, summary, taxonomyData;
|
|
167
168
|
return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
|
|
168
169
|
while (1) {
|
|
169
170
|
switch (_context2.prev = _context2.next) {
|
|
170
171
|
case 0:
|
|
171
|
-
|
|
172
|
+
parent_query = parent_id ? ' && parent._ref == \'' + parent_id + '\' ' : '';
|
|
173
|
+
query = '*[_type == \'taxonomy\' && identifier == \'' + url + '\' ' + parent_query + '][0]{summary,pixelTrackingCode->}';
|
|
172
174
|
summary = [];
|
|
173
|
-
_context2.prev =
|
|
174
|
-
_context2.next =
|
|
175
|
+
_context2.prev = 3;
|
|
176
|
+
_context2.next = 6;
|
|
175
177
|
return client.fetch(query);
|
|
176
178
|
|
|
177
|
-
case
|
|
179
|
+
case 6:
|
|
178
180
|
taxonomyData = _context2.sent;
|
|
179
181
|
|
|
180
182
|
if (taxonomyData.summary) {
|
|
181
183
|
summary = taxonomyData.summary;
|
|
182
184
|
}
|
|
183
|
-
_context2.next =
|
|
185
|
+
_context2.next = 13;
|
|
184
186
|
break;
|
|
185
187
|
|
|
186
|
-
case
|
|
187
|
-
_context2.prev =
|
|
188
|
-
_context2.t0 = _context2['catch'](
|
|
188
|
+
case 10:
|
|
189
|
+
_context2.prev = 10;
|
|
190
|
+
_context2.t0 = _context2['catch'](3);
|
|
189
191
|
|
|
190
192
|
console.error(_context2.t0);
|
|
191
193
|
|
|
192
|
-
case
|
|
194
|
+
case 13:
|
|
193
195
|
return _context2.abrupt('return', summary);
|
|
194
196
|
|
|
195
|
-
case
|
|
197
|
+
case 14:
|
|
196
198
|
case 'end':
|
|
197
199
|
return _context2.stop();
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
|
-
}, _callee2, _this, [[
|
|
202
|
+
}, _callee2, _this, [[3, 10]]);
|
|
201
203
|
}));
|
|
202
204
|
|
|
203
205
|
return function () {
|
|
@@ -156,41 +156,43 @@ TaxonomyDescription.getDescription = function () {
|
|
|
156
156
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
157
157
|
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
158
158
|
var client = arguments[1];
|
|
159
|
-
var
|
|
159
|
+
var parent_id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
160
|
+
var parent_query, query, summary, taxonomyData;
|
|
160
161
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
161
162
|
while (1) {
|
|
162
163
|
switch (_context2.prev = _context2.next) {
|
|
163
164
|
case 0:
|
|
164
|
-
|
|
165
|
+
parent_query = parent_id ? ' && parent._ref == \'' + parent_id + '\' ' : '';
|
|
166
|
+
query = '*[_type == \'taxonomy\' && identifier == \'' + url + '\' ' + parent_query + '][0]{summary,pixelTrackingCode->}';
|
|
165
167
|
summary = [];
|
|
166
|
-
_context2.prev =
|
|
167
|
-
_context2.next =
|
|
168
|
+
_context2.prev = 3;
|
|
169
|
+
_context2.next = 6;
|
|
168
170
|
return client.fetch(query);
|
|
169
171
|
|
|
170
|
-
case
|
|
172
|
+
case 6:
|
|
171
173
|
taxonomyData = _context2.sent;
|
|
172
174
|
|
|
173
175
|
if (taxonomyData.summary) {
|
|
174
176
|
summary = taxonomyData.summary;
|
|
175
177
|
}
|
|
176
|
-
_context2.next =
|
|
178
|
+
_context2.next = 13;
|
|
177
179
|
break;
|
|
178
180
|
|
|
179
|
-
case
|
|
180
|
-
_context2.prev =
|
|
181
|
-
_context2.t0 = _context2['catch'](
|
|
181
|
+
case 10:
|
|
182
|
+
_context2.prev = 10;
|
|
183
|
+
_context2.t0 = _context2['catch'](3);
|
|
182
184
|
|
|
183
185
|
console.error(_context2.t0);
|
|
184
186
|
|
|
185
|
-
case
|
|
187
|
+
case 13:
|
|
186
188
|
return _context2.abrupt('return', summary);
|
|
187
189
|
|
|
188
|
-
case
|
|
190
|
+
case 14:
|
|
189
191
|
case 'end':
|
|
190
192
|
return _context2.stop();
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
|
-
}, _callee2, _this, [[
|
|
195
|
+
}, _callee2, _this, [[3, 10]]);
|
|
194
196
|
}));
|
|
195
197
|
|
|
196
198
|
return function () {
|