diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-23 00:20:08 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-23 00:24:39 +0100 |
| commit | 368fbbf83b913b90cef9dfbe4288e148d589d033 (patch) | |
| tree | e86d6006dec67ffe485cbab5141609759ce7d501 /src/components/Widgets/TopicsList | |
| parent | 6d514259dd5e60af83b42f938ea9f6b017b7377f (diff) | |
refactor: rename all subject occurrences into topic
I change the name in graphql endpoint, so I decided to repercute this
change here.
Diffstat (limited to 'src/components/Widgets/TopicsList')
| -rw-r--r-- | src/components/Widgets/TopicsList/TopicsList.tsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/components/Widgets/TopicsList/TopicsList.tsx b/src/components/Widgets/TopicsList/TopicsList.tsx index c7843b7..5b0c44e 100644 --- a/src/components/Widgets/TopicsList/TopicsList.tsx +++ b/src/components/Widgets/TopicsList/TopicsList.tsx @@ -1,7 +1,7 @@ import Spinner from '@components/Spinner/Spinner'; import { ExpandableWidget, List } from '@components/WidgetParts'; import { t } from '@lingui/macro'; -import { getAllSubjects } from '@services/graphql/queries'; +import { getAllTopics } from '@services/graphql/queries'; import { TitleLevel } from '@ts/types/app'; import Link from 'next/link'; import { useRouter } from 'next/router'; @@ -20,7 +20,7 @@ const TopicsList = ({ ? router.asPath.replace('/sujet/', '') : ''; - const { data, error } = useSWR('/api/subjects', getAllSubjects); + const { data, error } = useSWR('/api/topics', getAllTopics); const getList = () => { if (error) return <ul>{t`Failed to load.`}</ul>; @@ -31,11 +31,11 @@ const TopicsList = ({ </ul> ); - const subjects = data.map((subject) => { - return currentTopicSlug !== subject.slug ? ( - <li key={subject.databaseId}> - <Link href={`/sujet/${subject.slug}`}> - <a>{subject.title}</a> + const topics = data.map((topic) => { + return currentTopicSlug !== topic.slug ? ( + <li key={topic.databaseId}> + <Link href={`/sujet/${topic.slug}`}> + <a>{topic.title}</a> </Link> </li> ) : ( @@ -43,7 +43,7 @@ const TopicsList = ({ ); }); - return <List items={subjects} />; + return <List items={topics} />; }; return ( |
