File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
components/sections/learning-modules/InteractiveModule
pages/communities/[slug]/challenges/[challenge_id]/learning-modules Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import { authCheck } from "@/store/feature/auth.slice";
11
11
import { Course , InteractiveModule as InteractiveModuleType } from "@/types/course" ;
12
12
import { hidePageNavigation , showPageNavigation } from "@/store/feature/communities/navigation.slice" ;
13
13
import { checkAnswer } from "@/store/feature/learningModules.slice" ;
14
- import { IRootState } from "@/store" ;
15
14
import { submitModuleAnswer } from "@/store/services/learningModules.service" ;
15
+ import { IRootState } from "@/store" ;
16
16
17
17
/**
18
18
* interface for InteractiveModule multiSelector
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ import PageNavigation from "@/components/sections/courses/PageNavigation";
24
24
import ChallengeCard from "@/components/cards/challenge/Challenge" ;
25
25
import { useTranslation } from "next-i18next" ;
26
26
27
-
28
27
/**
29
28
* Learning module page props interfae
30
29
* @date 4/24/2023 - 8:36:15 PM
Original file line number Diff line number Diff line change 1
1
import { createApi } from "@reduxjs/toolkit/query/react" ;
2
2
import baseQuery from "@/config/baseQuery" ;
3
+ import { setCurrentLearningModule , setLearningModuleList } from "../feature/learningModules.slice" ;
3
4
4
5
/**
5
6
* Learning module api service
@@ -19,6 +20,10 @@ export const learningModulesService = createApi({
19
20
"accept-language" : locale ,
20
21
} ,
21
22
} ) ,
23
+ onQueryStarted : async ( _ , { dispatch, queryFulfilled } ) => {
24
+ const { data } = await queryFulfilled ;
25
+ dispatch ( setCurrentLearningModule ( data ) ) ;
26
+ } ,
22
27
} ) ,
23
28
24
29
getAllLearningModules : builder . query ( {
@@ -28,6 +33,10 @@ export const learningModulesService = createApi({
28
33
"accept-language" : locale ,
29
34
} ,
30
35
} ) ,
36
+ onQueryStarted : async ( _ , { dispatch, queryFulfilled } ) => {
37
+ const { data } = await queryFulfilled ;
38
+ dispatch ( setLearningModuleList ( data ) ) ;
39
+ } ,
31
40
} ) ,
32
41
33
42
submitModuleAnswer : builder . query ( {
You can’t perform that action at this time.
0 commit comments