Skip to content

Commit b3782bb

Browse files
committed
Fix bug in newsId fetch when different language url
1 parent 4f76f40 commit b3782bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/url.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const getNewsIdFromUrl = () => {
22
const pathname = window.location.pathname;
3-
const [, , newsId] = pathname.split('/');
3+
const newsId = pathname.split('/')[-1];
44

55
return newsId ? { newsFlashId: +newsId } : { pageNumber: 1 };
66
};

0 commit comments

Comments
 (0)