@time2win/t2w 1.4.10 → 1.4.11
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/CHANGELOG.md +4 -0
- package/index.js +13 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 1.4.11 - 2024-09-11
|
|
9
|
+
### Removed
|
|
10
|
+
age calculation for participant infos - this is temporary to decrease requests
|
|
11
|
+
|
|
8
12
|
## 1.4.10 - 2024-08-04
|
|
9
13
|
### Modified
|
|
10
14
|
added readonly pageSize field to t2w package and set it to 250 for all requests
|
package/index.js
CHANGED
|
@@ -255,7 +255,7 @@ var Time2WinAPI = /** @class */ (function () {
|
|
|
255
255
|
};
|
|
256
256
|
fetch(_this.getUrl("/participants/".concat(eventId, "/individuals"), queryParams))
|
|
257
257
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () {
|
|
258
|
-
var body, race, _a, _b, _c;
|
|
258
|
+
var body, race_1, race, _a, _b, _c;
|
|
259
259
|
var _d;
|
|
260
260
|
var _this = this;
|
|
261
261
|
return __generator(this, function (_e) {
|
|
@@ -267,22 +267,28 @@ var Time2WinAPI = /** @class */ (function () {
|
|
|
267
267
|
reject(body);
|
|
268
268
|
return [2 /*return*/];
|
|
269
269
|
}
|
|
270
|
+
if (!!raceId) return [3 /*break*/, 3];
|
|
270
271
|
return [4 /*yield*/, this.getEventData(eventId)];
|
|
271
272
|
case 2:
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
race_1 = (_e.sent()).races.find(function (r) { return r.race_id === raceId; });
|
|
274
|
+
_e.label = 3;
|
|
275
|
+
case 3:
|
|
276
|
+
race = null;
|
|
277
|
+
if (!body.page_more) return [3 /*break*/, 5];
|
|
274
278
|
_b = (_a = (_d = body.list).push).apply;
|
|
275
279
|
_c = [_d];
|
|
276
280
|
return [4 /*yield*/, this.getParticipantInfos(eventId, raceId, dataExtra, gender, body.page + 1)];
|
|
277
|
-
case
|
|
281
|
+
case 4:
|
|
278
282
|
_b.apply(_a, _c.concat([(_e.sent()).list]));
|
|
279
283
|
body.page_more = false;
|
|
280
284
|
body.page = Math.ceil(body.list.length / body.page_size);
|
|
281
285
|
resolve(body);
|
|
282
|
-
_e.label =
|
|
283
|
-
case
|
|
286
|
+
_e.label = 5;
|
|
287
|
+
case 5:
|
|
284
288
|
body.list = body.list.map(function (p) {
|
|
285
|
-
return __assign(__assign({}, p), { birthdate: p.birthdate ? new Date(p.birthdate) : null,
|
|
289
|
+
return __assign(__assign({}, p), { birthdate: p.birthdate ? new Date(p.birthdate) : null,
|
|
290
|
+
// age: p.birthdate && race ? this.calculateAge(new Date(p.birthdate), race.starttime) : null,
|
|
291
|
+
year: p.birthdate ? new Date(p.birthdate).getFullYear() : null, order_date: p.order_date ? new Date(p.order_date) : null, racenumNumeric: _this.getNumericBib(p.racenum) });
|
|
286
292
|
});
|
|
287
293
|
resolve(body);
|
|
288
294
|
return [2 /*return*/];
|