JSON.stringify event data.
ARCH-492
This commit is contained in:
@@ -18,7 +18,7 @@ function logEvent(eventType, eventData) {
|
||||
const snakeEventData = snakeCaseObject(eventData, { deep: true });
|
||||
const serverData = {
|
||||
event_type: eventType,
|
||||
event: snakeEventData,
|
||||
event: JSON.stringify(snakeEventData),
|
||||
page: window.location.href,
|
||||
};
|
||||
return apiClient.post(eventLogApiBaseUrl, serverData)
|
||||
|
||||
@@ -32,12 +32,7 @@ describe('analytics logEvent', () => {
|
||||
expect(apiClient.post.mock.calls[0][0]).toEqual(`${configuration.LMS_BASE_URL}/event`);
|
||||
expect(apiClient.post.mock.calls[0][1]).toEqual({
|
||||
event_type: 'test.event',
|
||||
event: {
|
||||
test_shallow: 'test-shallow',
|
||||
test_object: {
|
||||
test_deep: 'test-deep',
|
||||
},
|
||||
},
|
||||
event: '{"test_shallow":"test-shallow","test_object":{"test_deep":"test-deep"}}',
|
||||
page: window.location.href,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user