From d53d375d09dd86a85ffb249de1c0cc7c3b3438bc Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 4 Jan 2022 13:35:25 +0100
Subject: refactor: avoid useless assignement before return statement

---
 src/pages/recherche/index.tsx | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

(limited to 'src/pages/recherche/index.tsx')

diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx
index b39d3f9..c1ea0d3 100644
--- a/src/pages/recherche/index.tsx
+++ b/src/pages/recherche/index.tsx
@@ -28,16 +28,13 @@ const Search: NextPageWithLayout = () => {
   const getKey = (pageIndex: number, previousData: PostsListData) => {
     if (previousData && !previousData.posts) return null;
 
-    const args =
-      pageIndex === 0
-        ? { first: config.postsPerPage, searchQuery: query }
-        : {
-            first: config.postsPerPage,
-            after: previousData.pageInfo.endCursor,
-            searchQuery: query,
-          };
-
-    return args;
+    return pageIndex === 0
+      ? { first: config.postsPerPage, searchQuery: query }
+      : {
+          first: config.postsPerPage,
+          after: previousData.pageInfo.endCursor,
+          searchQuery: query,
+        };
   };
 
   const { data, error, size, setSize } = useSWRInfinite(
-- 
cgit v1.2.3

