@@ -17,13 +17,14 @@ import { useRouter } from "next/router";
17
17
import Loader from "@/components/ui/Loader" ;
18
18
import Section from "@/components/ui/Section" ;
19
19
import { useSelector } from "@/hooks/useTypedSelector" ;
20
+ import { fetchChallenge } from "@/store/services/communities/challenges" ;
20
21
21
22
export default function SubmissionPage ( ) {
22
23
const dispatch = useDispatch ( ) ;
23
24
const { t } = useTranslation ( ) ;
24
25
const navigation = useNavigation ( ) ;
25
26
const router = useRouter ( ) ;
26
- const { slug, locale, submission_id } = router . query ;
27
+ const { slug, locale, submission_id, challenge_id } = router . query ;
27
28
const [ loading , setLoading ] = useState ( true ) ;
28
29
const { current } = useSelector ( ( state ) => state . submissions ) ;
29
30
@@ -33,7 +34,11 @@ export default function SubmissionPage() {
33
34
locale : locale as string ,
34
35
} ;
35
36
setLoading ( true ) ;
36
- await Promise . all ( [ dispatch ( fetchCurrentCommunity ( fetchCurrentCommunityPayload ) ) , dispatch ( findSubmssionById ( { id : submission_id as string } ) ) ] ) ;
37
+ await Promise . all ( [
38
+ dispatch ( fetchChallenge ( { id : challenge_id as string , relations : [ "rubric" ] } ) ) ,
39
+ dispatch ( fetchCurrentCommunity ( fetchCurrentCommunityPayload ) ) ,
40
+ dispatch ( findSubmssionById ( { id : submission_id as string } ) ) ,
41
+ ] ) ;
37
42
dispatch ( initChallengeNavigationMenu ( navigation . community ) ) ;
38
43
setLoading ( false ) ;
39
44
} , [ slug , submission_id ] ) ;
0 commit comments