Skip to content

Commit

Permalink
Merge pull request OneUptime#1679 from OneUptime/oneuptime-copilot-on…
Browse files Browse the repository at this point in the history
…euptime-copilot-improve-comments-UdHQs

Improved comments on /App/FeatureSet/Home/Static/js/switchUrl.js
  • Loading branch information
simlarsen authored Sep 8, 2024
2 parents 97c2e65 + c5cf48d commit 9fbdc68
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion App/FeatureSet/Home/Static/js/switchUrl.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
let accountsUrl = window.location.origin + "/accounts";

// Determine the backend URL based on whether the hostname is 'localhost'
let backendUrl =
window.location.hostname === "localhost"
? "http://localhost:3002"
: window.location.origin + "/api";

// Redirect user to login page with optional extra path
//eslint-disable-next-line
function loginUrl(extra) {
if (extra) {
Expand All @@ -12,6 +15,8 @@ function loginUrl(extra) {
window.location.href = `${accountsUrl}/login`;
}
}

// Redirect user to register page with optional query parameters
//eslint-disable-next-line
function registerUrl(params) {
if (params) {
Expand All @@ -20,7 +25,9 @@ function registerUrl(params) {
window.location.href = `${accountsUrl}/register`;
}
}

// Get the URL for submitting a lead form to the backend
//eslint-disable-next-line
function formUrl() {
return `${backendUrl}/lead/`;
}
}

0 comments on commit 9fbdc68

Please sign in to comment.