Use Discourse.getURL for /clicks/track so clicks can be tracked on relative URLs (#8079)
This commit is contained in:
parent
1d73754e84
commit
530356f465
|
@ -159,7 +159,7 @@ export function ajax() {
|
|||
if (
|
||||
args.type &&
|
||||
args.type.toUpperCase() !== "GET" &&
|
||||
url !== "/clicks/track" &&
|
||||
url !== Discourse.getURL("/clicks/track") &&
|
||||
!Discourse.Session.currentProp("csrfToken")
|
||||
) {
|
||||
promise = new Ember.RSVP.Promise((resolve, reject) => {
|
||||
|
|
|
@ -102,9 +102,9 @@ export default {
|
|||
data.append("url", href);
|
||||
data.append("post_id", postId);
|
||||
data.append("topic_id", topicId);
|
||||
navigator.sendBeacon("/clicks/track", data);
|
||||
navigator.sendBeacon(Discourse.getURL("/clicks/track"), data);
|
||||
} else {
|
||||
trackPromise = ajax("/clicks/track", {
|
||||
trackPromise = ajax(Discourse.getURL("/clicks/track"), {
|
||||
type: "POST",
|
||||
data: {
|
||||
url: href,
|
||||
|
|
Loading…
Reference in New Issue