From fa6adedc42e9c6ec39cc30df16b54900c220b094 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Dec 2021 00:15:20 +0100 Subject: refactor: rewrite types and services I was repeating myself a lot in services. So I rewrited the different functions to improve readability and I extracted some formatting functions to put them in utils. I also rewrited/reorganized some types to keep consistent names. --- src/pages/thematique/[slug].tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pages/thematique') diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index 1919b59..2e7c346 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -1,10 +1,6 @@ import Layout from '@components/Layouts/Layout'; import PostPreview from '@components/PostPreview/PostPreview'; import { t } from '@lingui/macro'; -import { - fetchAllThematicsSlug, - getThematicBySlug, -} from '@services/graphql/taxonomies'; import { NextPageWithLayout } from '@ts/types/app'; import { ThematicProps } from '@ts/types/taxonomies'; import { loadTranslation } from '@utils/helpers/i18n'; @@ -12,6 +8,10 @@ import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; import { ParsedUrlQuery } from 'querystring'; import { ReactElement } from 'react'; import styles from '@styles/pages/Thematic.module.scss'; +import { + getAllThematicsSlug, + getThematicBySlug, +} from '@services/graphql/queries'; const Thematic: NextPageWithLayout = ({ thematic }) => { const getPostsList = () => { @@ -66,7 +66,7 @@ export const getStaticProps: GetStaticProps = async ( }; export const getStaticPaths: GetStaticPaths = async () => { - const allSlugs = await fetchAllThematicsSlug(); + const allSlugs = await getAllThematicsSlug(); return { paths: allSlugs.map((post) => `/thematique/${post.slug}`), -- cgit v1.2.3