@selfcommunity/react-core 0.6.4-courses.154 → 0.6.4-courses.156

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,15 +49,15 @@ function useSCFetchLesson({ id = null, lesson = null, courseId = null, sectionId
49
49
  * If id attempt to get the lesson by id
50
50
  */
51
51
  (0, react_1.useEffect)(() => {
52
- if (id !== null && id !== undefined && courseId !== null && courseId !== undefined && sectionId) {
53
- fetchLesson(id)
52
+ if (__lessonId && courseId && sectionId) {
53
+ fetchLesson(__lessonId)
54
54
  .then((e) => {
55
55
  setSCLesson(e);
56
56
  })
57
57
  .catch((err) => {
58
58
  utils_1.LRUCache.delete(__lessonCacheKey);
59
- setError(`Lesson with id ${id} not found`);
60
- utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Lesson with id ${id} not found`);
59
+ setError(`Lesson with id ${__lessonId} not found`);
60
+ utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Lesson with id ${__lessonId} not found`);
61
61
  utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
62
62
  });
63
63
  }
@@ -47,15 +47,15 @@ export default function useSCFetchLesson({ id = null, lesson = null, courseId =
47
47
  * If id attempt to get the lesson by id
48
48
  */
49
49
  useEffect(() => {
50
- if (id !== null && id !== undefined && courseId !== null && courseId !== undefined && sectionId) {
51
- fetchLesson(id)
50
+ if (__lessonId && courseId && sectionId) {
51
+ fetchLesson(__lessonId)
52
52
  .then((e) => {
53
53
  setSCLesson(e);
54
54
  })
55
55
  .catch((err) => {
56
56
  LRUCache.delete(__lessonCacheKey);
57
- setError(`Lesson with id ${id} not found`);
58
- Logger.error(SCOPE_SC_CORE, `Lesson with id ${id} not found`);
57
+ setError(`Lesson with id ${__lessonId} not found`);
58
+ Logger.error(SCOPE_SC_CORE, `Lesson with id ${__lessonId} not found`);
59
59
  Logger.error(SCOPE_SC_CORE, err.message);
60
60
  });
61
61
  }