Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

fix sending endpoint prop from sources and countries modals (#4376)

RobertJoonas2edf3c94a3d3
diff --git a/assets/js/dashboard/stats/modals/locations-modal.js b/assets/js/dashboard/stats/modals/locations-modal.js
index 75373924c6..7c0f80d606 100644
--- a/assets/js/dashboard/stats/modals/locations-modal.js
+++ b/assets/js/dashboard/stats/modals/locations-modal.js
@@ -23,7 +23,7 @@ function LocationsModal({ location }) {
const currentView = urlParts[urlParts.length - 1]
let reportInfo = VIEWS[currentView]
- reportInfo.endpoint = url.apiPath(site, reportInfo.endpoint)
+ reportInfo = {...reportInfo, endpoint: url.apiPath(site, reportInfo.endpoint)}
const getFilterInfo = useCallback((listItem) => {
return {
diff --git a/assets/js/dashboard/stats/modals/sources.js b/assets/js/dashboard/stats/modals/sources.js
index 85b4f1bcef..1d8b45afd7 100644
--- a/assets/js/dashboard/stats/modals/sources.js
+++ b/assets/js/dashboard/stats/modals/sources.js
@@ -47,7 +47,7 @@ function SourcesModal({ location }) {
const currentView = urlParts[urlParts.length - 1]
let reportInfo = VIEWS[currentView].info
- reportInfo.endpoint = url.apiPath(site, reportInfo.endpoint)
+ reportInfo = {...reportInfo, endpoint: url.apiPath(site, reportInfo.endpoint)}
const getFilterInfo = useCallback((listItem) => {
return {