File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -497,12 +497,14 @@ type Props = SSRProps<{
497
497
} > ;
498
498
499
499
export const getServerSideProps : GetServerSideProps < Props > = async ( ctx ) => {
500
- // eslint-disable-next-line react-hooks/rules-of-hooks
501
- const res = await fetch ( 'https://api.stats.fm/api/v1/me/available-pronouns' )
502
- . then ( ( res ) => res . json ( ) )
503
- . then ( ( res ) => res . items ) ;
504
- const pronouns = Object . values ( res ) . flat ( ) as Pronoun [ ] ;
505
500
const user = await fetchUser ( ctx ) ;
501
+ const pronounsResponse = await fetch (
502
+ 'https://api.stats.fm/api/v1/me/available-pronouns' ,
503
+ ) ;
504
+ const { items : pronounsItems } = await pronounsResponse . json ( ) ;
505
+ const pronouns = Object . values < Pronoun > ( pronounsItems ) . filter (
506
+ ( { aliases } ) => aliases . length !== 0 ,
507
+ ) ;
506
508
507
509
return {
508
510
props : {
You can’t perform that action at this time.
0 commit comments