chore (frontend): move url in frontend

This commit is contained in:
MickaelK
2023-11-27 20:58:54 +11:00
parent def45d5ad5
commit dd6e91c493
151 changed files with 63 additions and 36 deletions

View File

@ -0,0 +1,12 @@
export function report(msg, error, link, lineNo, columnNo) {
if (window.navigator.onLine === false) return Promise.resolve();
let url = "/report?";
url += "url=" + encodeURIComponent(location.href) + "&";
url += "msg=" + encodeURIComponent(msg) + "&";
url += "from=" + encodeURIComponent(link) + "&";
url += "from.lineNo=" + lineNo + "&";
url += "from.columnNo=" + columnNo;
if (error) url += "error=" + encodeURIComponent(error.message) + "&";
return fetch(url, { method: "post" }).catch(() => {});
}