fix(report_tables): match reports path anywhere in pathname for export

Remove anchored `^` from regex matching `/reports/:id` segment when
building export-all URL. Pathname may be prefixed (e.g. locale or
base path segment before `/reports/...`), so anchoring to start of
string caused match to fail and export link to be built incorrectly.
Unanchored pattern finds reports segment regardless of position.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
This commit is contained in:
objecttothis committed 2026-10-23 16:27:22 +04:00
1 parent 1349e228f7
commit ff6ea5cb0d
1 file changed
+1 -1
+1 -1
View File
@@ -62,7 +62,7 @@ const report_export_toggle = (function () {
$exportItem.closest('.dropdown-menu').prev('[data-toggle="dropdown"]').dropdown('toggle');
const path = location.pathname.replace(/^(\/reports\/[^/]+)/, '$1/exportAll/' + format);
const path = location.pathname.replace(/(\/reports\/[^/]+)/, '$1/exportAll/' + format);
window.location = path + location.search;
}, true);
};