From a4ae2783362a79fd9f541a0f45c41de8757aa66e Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 4 Jan 2022 13:36:18 +0100 Subject: refactor: avoid mutated array with reverse method --- src/pages/sujet/[slug].tsx | 2 +- src/pages/thematique/[slug].tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index f6571e1..527d529 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -15,7 +15,7 @@ import { const Subject: NextPageWithLayout = ({ subject }) => { const getPostsList = () => { - return subject.posts.reverse().map((post) => ( + return [...subject.posts].reverse().map((post) => (
  • diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index 51506e5..74c2212 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -14,7 +14,7 @@ import { const Thematic: NextPageWithLayout = ({ thematic }) => { const getPostsList = () => { - return thematic.posts.reverse().map((post) => ( + return [...thematic.posts].reverse().map((post) => (
  • -- cgit v1.2.3