From 6a4a2aa60eaf28bf073a86f5b365f28d1b8588e5 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 4 Dec 2024 10:18:19 -0500 Subject: [PATCH] chore: some nits --- src/data/api.js | 2 +- src/data/api.test.js | 2 +- src/data/thunks.js | 1 - src/widgets/Xpert.jsx | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/data/api.js b/src/data/api.js index 4450e269..09f04b9b 100644 --- a/src/data/api.js +++ b/src/data/api.js @@ -24,7 +24,7 @@ async function fetchChatResponse(courseId, messageList, unitId, customQueryParam } async function fetchLearningAssistantSummary(courseId) { - const url = new URL(`${getConfig().CHAT_RESPONSE_URL}/${courseId}/summary`); + const url = new URL(`${getConfig().CHAT_RESPONSE_URL}/${courseId}/chat-summary`); const { data } = await getAuthenticatedHttpClient().get(url.href); return data; diff --git a/src/data/api.test.js b/src/data/api.test.js index d558122e..da61e169 100644 --- a/src/data/api.test.js +++ b/src/data/api.test.js @@ -54,7 +54,7 @@ describe('API', () => { expect(response).toEqual(apiPayload); expect(mockGet).toHaveBeenCalledTimes(1); - expect(mockGet).toHaveBeenCalledWith(`${CHAT_RESPONSE_URL}/${courseId}/summary`); + expect(mockGet).toHaveBeenCalledWith(`${CHAT_RESPONSE_URL}/${courseId}/chat-summary`); }); }); }); diff --git a/src/data/thunks.js b/src/data/thunks.js index 501e588b..037be51e 100644 --- a/src/data/thunks.js +++ b/src/data/thunks.js @@ -119,7 +119,6 @@ export function getLearningAssistantSummary(courseId) { const messageList = rawMessageList .map(({ timestamp, ...msg }) => ({ ...msg, - // NOTE to self: can't store Date() objects in store: https://github.com/reduxjs/redux-toolkit/issues/456 timestamp: new Date(timestamp).toString(), // Parse ISO time to Date() })); diff --git a/src/widgets/Xpert.jsx b/src/widgets/Xpert.jsx index ce36c6dc..b15853b6 100644 --- a/src/widgets/Xpert.jsx +++ b/src/widgets/Xpert.jsx @@ -26,7 +26,7 @@ const Xpert = ({ courseId, contentToolsEnabled, unitId }) => { dispatch(getLearningAssistantSummary(courseId)); }, [dispatch, courseId]); - // NOTE: This value can be used later on if/when we pass the enrollment mode to this componentn + // NOTE: This value can be used later on if/when we pass the enrollment mode to this component const isAuditTrialNotExpired = () => { // eslint-disable-line no-unused-vars const auditTrialExpired = (Date.now() - auditTrial.expirationDate) > 0; if (auditTrialExpired) {