feat: add explicit courserun_key parameter to /event endpoint

We add 'courserun_key' (aka "course_id" though that's technically a
misnomer) as an optional parameter to the /event endpoint url. If it
is not present, it will still be parsed out of the url, if the url is
of the right format.

Additionally, Logger.log() in js adds this parameter to its /event
call, pulling it from the $$course_id global.

This provides opportunity for MFEs to (separately) provide the key
without concern about url parsing.

TNL-7752
This commit is contained in:
Ken Clary
2021-07-30 10:23:23 -04:00
parent ae105636f0
commit 13b6ed901a
3 changed files with 22 additions and 18 deletions

View File

@@ -59,6 +59,7 @@
return sendRequest({
event_type: eventType,
event: JSON.stringify(data),
courserun_key: $$course_id,
page: window.location.href
}, requestOptions);
},