Modified frontend reporting logic to be more flexible with campaigns that include a path in their URL.

Fixes #1985
pull/2060/head
Jordan Wright 2020-09-23 21:15:03 -05:00
parent 0b2ab68f8d
commit c1d3c7cd75
2 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -933,9 +933,9 @@ function report_mail(rid, cid) {
}).then(function (result) { }).then(function (result) {
if (result.value){ if (result.value){
api.campaignId.get(cid).success((function(c) { api.campaignId.get(cid).success((function(c) {
report_url = c.url; report_url = new URL(c.url)
report_url += report_url.endsWith("/") ? "" : "/"; report_url.pathname = '/report'
report_url += "report?rid=" + rid; report_url.search = "?rid=" + rid
$.ajax({ $.ajax({
url: report_url, url: report_url,
method: "GET", method: "GET",