Skip to content

Commit 9f6b106

Browse files
committed
update fission events
1 parent 346564a commit 9f6b106

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

os-app/task-d-events/controller-tests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('ZDAEventURLFission', function test_ZDAEventURLFission() {
2626

2727
it('returns string', function () {
2828
deepEqual(mod.ZDAEventURLFission(), mod.ZDAEventURLs().filter(function (e) {
29-
return e.match(/q0wId4DZFlx7LCP/i);
29+
return e.match(/fission/i);
3030
}).shift());
3131
});
3232

@@ -105,7 +105,7 @@ describe('_DataEventObjects', function test__DataEventObjects() {
105105
ZDAEventStart: new Date(),
106106
}, inputData);
107107

108-
return `<script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps": {"initialData": {"events": [{"name": "${ item.ZDAEventName }","url": "${ item.ZDAEventURL }","start_at": "${ item.ZDAEventStart.toJSON() }","duration_minutes": 90,"visibility": "public","cover_url": "https://cdn.lu.ma/event-covers/se/3ec890e2-f604-4e76-ad7b-69996063b386","event_type": "independent","recurrence_id": null,"api_id": "evt-nHhXeNbXYwW4DW1","session_count_total": null,"session_count_future": null}]}}}}</script>`;
108+
return `<script id="__NEXT_DATA__" type="application/json">{"props":{"initialUserData":null,"randomSeed":0.4125239166066439,"countryCode":"CA","sha":"e43177ff3c9fb5e66e90db9ead58739e9021defe","initialLocale":null,"initialMessages":null,"pageProps":{"initialData":{"data":{"featured_items":[{"event":{"name":"${ item.ZDAEventName }","start_at":"${ item.ZDAEventStart.toJSON() }","url":"${ item.ZDAEventURL }"}}]}},"_sentryTraceData":"f9b43f74bb1c40ea8b672db7adb94cff-814265555acf4eac-0"}},"page":"/[...url]","query":{"url":["fission"]},"buildId":"d1Og0wHWZGo6L1FKcDWEC","isFallback":false,"isExperimentalCompile":false,"gip":true,"appGip":true,"scriptLoader":[]}</script>`;
109109
};
110110

111111
it('parses data', function () {
@@ -118,7 +118,7 @@ describe('_DataEventObjects', function test__DataEventObjects() {
118118
ZDAEventName,
119119
ZDAEventStart,
120120
})), [{
121-
ZDAEventURL: require('OLSKLink').OLSKLinkRelativeURL(mod.ZDAEventURLFission(), '/' + ZDAEventURL),
121+
ZDAEventURL,
122122
ZDAEventName,
123123
ZDAEventStart,
124124
}]);

os-app/task-d-events/controller.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const mod = {
4747

4848
ZDAEventURLFission () {
4949
return mod.ZDAEventURLs().filter(function (e) {
50-
return e.match(/q0wId4DZFlx7LCP/i);
50+
return e.match(/fission/i);
5151
}).shift();
5252
},
5353

@@ -85,11 +85,11 @@ const mod = {
8585
});
8686
},
8787
[mod.ZDAEventURLFission()]: function () {
88-
return (param2 ? JSON.parse(param2.split('<script id="__NEXT_DATA__" type="application/json">').pop().split('</script>').shift()).props.pageProps.initialData.events : []).map(function (e) {
88+
return (param2 ? JSON.parse(param2.split('<script id="__NEXT_DATA__" type="application/json">').pop().split('</script>').shift()).props.pageProps.initialData.data.featured_items : []).map(function (e) {
8989
return {
90-
ZDAEventURL: require('OLSKLink').OLSKLinkRelativeURL(param1, '/' + e.url),
91-
ZDAEventName: e.name,
92-
ZDAEventStart: new Date(e.start_at),
90+
ZDAEventURL: e.event.url,
91+
ZDAEventName: e.event.name,
92+
ZDAEventStart: new Date(e.event.start_at),
9393
};
9494
});
9595
},

0 commit comments

Comments
 (0)