From 64ab2d68ace17ee70958540bd95d180bf6c16610 Mon Sep 17 00:00:00 2001 From: Akanksha Date: Tue, 12 Nov 2024 22:10:59 +0530 Subject: [PATCH] dynamic url --- src/webapp/src/pages/bootcamps/BootcampsPage.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/webapp/src/pages/bootcamps/BootcampsPage.jsx b/src/webapp/src/pages/bootcamps/BootcampsPage.jsx index 543ff62..6b1eede 100644 --- a/src/webapp/src/pages/bootcamps/BootcampsPage.jsx +++ b/src/webapp/src/pages/bootcamps/BootcampsPage.jsx @@ -33,6 +33,12 @@ const BootcampsPage = () => { } }; fetchBootcamps(); + + // Update the URL + const url = new URL(window.location.href); + url.searchParams.set('page', currentPage); + url.searchParams.set('limit', itemsPerPage); + window.history.pushState({}, '', url.toString()); }, [currentPage]); const handlePaginationChange = (selectedPage) => {