FIX: deprecations

FIX: deprecations

diff --git a/assets/javascripts/initializers/extend-for-policy.js.es6 b/assets/javascripts/initializers/extend-for-policy.js.es6
index e25b6d0..4ada908 100644
--- a/assets/javascripts/initializers/extend-for-policy.js.es6
+++ b/assets/javascripts/initializers/extend-for-policy.js.es6
@@ -1,3 +1,4 @@
+import getURL from "discourse-common/lib/get-url";
 import { withPluginApi } from "discourse/lib/plugin-api";
 import { renderAvatar } from "discourse/helpers/user-avatar";
 import { ajax } from "discourse/lib/ajax";
@@ -223,7 +224,7 @@ function initializePolicy(api) {
 
   function _saveSettings($list, existingSettings, post) {
     const newSettings = _getSettingsValueFromForm($list);
-    const endpoint = Discourse.getURL(`/posts/${post.id}`);
+    const endpoint = getURL(`/posts/${post.id}`);
     const options = { type: "GET", cache: false };
     return ajax(endpoint, options).then(result => {
       const raw = result.raw;
@@ -345,7 +346,7 @@ function initializePolicy(api) {
       render($policy, post);
     }
 
-    const endpoint = Discourse.getURL("/policy/unaccept");
+    const endpoint = getURL("/policy/unaccept");
     ajax(endpoint, {
       type: "put",
       data: {
@@ -366,7 +367,7 @@ function initializePolicy(api) {
       accepted.addObject(elem);
       render($policy, post);
     }
-    const endpoint = Discourse.getURL("/policy/accept");
+    const endpoint = getURL("/policy/accept");
     ajax(endpoint, {
       type: "put",
       data: {
@@ -383,7 +384,7 @@ function initializePolicy(api) {
     const $policy = $(`article[data-post-id=${message.id}] .policy`);
 
     if (post && $policy.length > 0) {
-      const endpoint = Discourse.getURL(`/posts/${message.id}.json`);
+      const endpoint = getURL(`/posts/${message.id}.json`);
       ajax(endpoint).then(data => {
         post.set("policy_accepted_by", data.policy_accepted_by || []);
         post.set("policy_not_accepted_by", data.policy_not_accepted_by || []);

GitHub sha: 84cfc8e5