Skip to content

Commit

Permalink
chore: update logInfo to reflect query keys during skipped query cach…
Browse files Browse the repository at this point in the history
…e updates
  • Loading branch information
adamstankiewicz committed Dec 6, 2024
1 parent 1c08837 commit 9a9df20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const UnenrollModal = ({
bffQueryKeysToUpdate.forEach((queryKey) => {
const existingBFFData = queryClient.getQueryData(queryKey);
if (!existingBFFData) {
logInfo(`Skipping optimistic cache update of ${queryKey} as no cached query data exists yet.`);
logInfo(`Skipping optimistic cache update of ${JSON.stringify(queryKey)} as no cached query data exists yet.`);
return;
}
const updatedBFFData = {
Expand All @@ -69,7 +69,7 @@ const UnenrollModal = ({
const enterpriseCourseEnrollmentsQueryKey = queryEnterpriseCourseEnrollments(enterpriseCustomer.uuid).queryKey;
const existingCourseEnrollmentsData = queryClient.getQueryData(enterpriseCourseEnrollmentsQueryKey);
if (!existingCourseEnrollmentsData) {
logInfo('Skipping optimistic cache update of {existingCourseEnrollmentsData} as no cached query data exists yet.');
logInfo(`Skipping optimistic cache update of ${JSON.stringify(enterpriseCourseEnrollmentsQueryKey)} as no cached query data exists yet.`);
return;
}
const updatedCourseEnrollmentsData = existingCourseEnrollmentsData.filter(enrollmentForCourseFilter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export function handleQueriesForUpdatedCourseEnrollmentStatus({
bffQueryKeysToUpdate.forEach((queryKey) => {
const existingBFFData = queryClient.getQueryData(queryKey);
if (!existingBFFData) {
logInfo(`Skipping optimistic cache update of ${queryKey} as no cached query data exists yet.`);
logInfo(`Skipping optimistic cache update of ${JSON.stringify(queryKey)} as no cached query data exists yet.`);
return;
}
const updatedBFFData = {
Expand All @@ -571,7 +571,7 @@ export function handleQueriesForUpdatedCourseEnrollmentStatus({
const enterpriseCourseEnrollmentsQueryKey = queryEnterpriseCourseEnrollments(enterpriseCustomer.uuid).queryKey;
const existingCourseEnrollmentsData = queryClient.getQueryData(enterpriseCourseEnrollmentsQueryKey);
if (!existingCourseEnrollmentsData) {
logInfo('Skipping optimistic cache update of {existingCourseEnrollmentsData} as no cached query data exists yet.');
logInfo(`Skipping optimistic cache update of ${JSON.stringify(enterpriseCourseEnrollmentsQueryKey)} as no cached query data exists yet.`);
return;
}
const updatedCourseEnrollmentsData = existingCourseEnrollmentsData.map(transformUpdatedEnrollment);
Expand Down

0 comments on commit 9a9df20

Please sign in to comment.