mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-11-08 23:43:32 -05:00
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:
1 parent
1349e228f7
commit
ff6ea5cb0d
1 file changed
+1
-1
@@ -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);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user