mirror of
https://github.com/discourse/discourse.git
synced 2024-12-14 13:43:49 +08:00
Use Discourse.getURL for /clicks/track so clicks can be tracked on relative URLs (#8079)
This commit is contained in:
parent
39a427efce
commit
21c11c2bb2
|
@ -153,7 +153,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
Block a user