diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-04 13:35:25 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-04 13:35:25 +0100 |
| commit | d53d375d09dd86a85ffb249de1c0cc7c3b3438bc (patch) | |
| tree | 827e02f739a542e674e5d447f46ee97096f02cd7 /src/pages/recherche/index.tsx | |
| parent | ab5e5f4bdf40b5bc1ccf82dc1b4aca94d5171ec3 (diff) | |
refactor: avoid useless assignement before return statement
Diffstat (limited to 'src/pages/recherche/index.tsx')
| -rw-r--r-- | src/pages/recherche/index.tsx | 17 |
1 files changed, 7 insertions, 10 deletions
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( |
