From b3782bb89208bdbc832c94e116652e310a2016bc Mon Sep 17 00:00:00 2001 From: Shaked Hayek Date: Sat, 15 Feb 2025 21:20:09 +0200 Subject: [PATCH] Fix bug in newsId fetch when different language url --- src/utils/url.utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/url.utils.ts b/src/utils/url.utils.ts index 974efc01..174f2c97 100644 --- a/src/utils/url.utils.ts +++ b/src/utils/url.utils.ts @@ -1,6 +1,6 @@ export const getNewsIdFromUrl = () => { const pathname = window.location.pathname; - const [, , newsId] = pathname.split('/'); + const newsId = pathname.split('/')[-1]; return newsId ? { newsFlashId: +newsId } : { pageNumber: 1 }; };