From 368fbbf83b913b90cef9dfbe4288e148d589d033 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 23 Jan 2022 00:20:08 +0100 Subject: refactor: rename all subject occurrences into topic I change the name in graphql endpoint, so I decided to repercute this change here. --- src/components/Widgets/TopicsList/TopicsList.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/components/Widgets/TopicsList/TopicsList.tsx') 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 ; @@ -31,11 +31,11 @@ const TopicsList = ({ ); - const subjects = data.map((subject) => { - return currentTopicSlug !== subject.slug ? ( -
  • - - {subject.title} + const topics = data.map((topic) => { + return currentTopicSlug !== topic.slug ? ( +
  • + + {topic.title}
  • ) : ( @@ -43,7 +43,7 @@ const TopicsList = ({ ); }); - return ; + return ; }; return ( -- cgit v1.2.3