File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/pages/profile/[username]/communities Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import ProfileLayout from "@/layouts/ProfileLayout";
7
7
import { GetServerSideProps } from "next" ;
8
8
import { wrapper } from "@/store" ;
9
9
import { fetchProfileCommunity } from "@/store/services/profile/profileCommunities.service" ;
10
+ import { fetchUserProfile } from "@/store/services/profile/users.service" ;
10
11
11
12
export default function ProfileCommunities ( ) {
12
13
return (
@@ -24,12 +25,13 @@ ProfileCommunities.getLayout = function (page: ReactElement) {
24
25
export const getServerSideProps : GetServerSideProps = wrapper . getServerSideProps ( ( store ) => async ( { locale, query } ) => {
25
26
try {
26
27
const { slug, username } = query ;
27
-
28
+
28
29
const [ { data } , translations ] = await Promise . all ( [
29
30
store . dispatch ( fetchProfileCommunity ( { username : username as string , slug : slug as string } ) ) ,
31
+ store . dispatch ( fetchUserProfile ( ( username as string ) || "" ) ) ,
30
32
serverSideTranslations ( locale as string ) ,
31
33
] ) ;
32
-
34
+
33
35
return {
34
36
props : {
35
37
community : data . community ,
@@ -39,10 +41,9 @@ export const getServerSideProps: GetServerSideProps = wrapper.getServerSideProps
39
41
...translations ,
40
42
} ,
41
43
} ;
42
-
43
44
} catch ( error ) {
44
45
return {
45
- notFound : true
46
- }
46
+ notFound : true ,
47
+ } ;
47
48
}
48
49
} ) ;
You can’t perform that action at this time.
0 commit comments