From 958569e09071e4bb290f0ec120b4309ae5983d2d Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 24 Jan 2022 14:52:04 +0100 Subject: refactor(project): replace repo api call method with hook and swr Instead of using post slug and an environment variable to fetch repo data, I use the given repo in each project MDX file. It allows me to fetch data from another user/organization if needed. To make it work, I no longer provide the full URL in MDX file. The new format is: "User/repo-slug". I also replaced the fetch method with SWR to improve caching and to avoid React complaining about cleanup useEffect. --- src/pages/projet/[slug].tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages') diff --git a/src/pages/projet/[slug].tsx b/src/pages/projet/[slug].tsx index 82e2ea3..0f3aea9 100644 --- a/src/pages/projet/[slug].tsx +++ b/src/pages/projet/[slug].tsx @@ -103,7 +103,7 @@ const Project: NextPageWithLayout = ({
- +
-- cgit v1.2.3