Pass data to url method to avoid duplication

Pass data to url method to avoid duplication

diff --git a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
index 5fd5187..84a60b2 100644
--- a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
@@ -28,9 +28,8 @@ export const DefaultNotificationItem =
       return classNames;
     },
 
-    url() {
+    url(data) {
       const attrs = this.attrs;
-      const data = attrs.data;
 
       const badgeId = data.badge_id;
       if (badgeId) {
@@ -119,7 +118,7 @@ export const DefaultNotificationItem =
 
       let contents = [icon, html];
 
-      const href = this.url();
+      const href = this.url(data);
       return href
         ? h(
             "a",
@@ -143,7 +142,7 @@ export const DefaultNotificationItem =
       e.preventDefault();
 
       this.sendWidgetEvent("linkClicked");
-      DiscourseURL.routeTo(this.url(), {
+      DiscourseURL.routeTo(this.url(this.attrs.data), {
         afterRouteComplete: () => {
           if (!this.attrs.data.revision_number) {
             return;
diff --git a/app/assets/javascripts/discourse/widgets/invitee-accepted-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/invitee-accepted-notification-item.js.es6
index 1e357df..7d2c5e6 100644
--- a/app/assets/javascripts/discourse/widgets/invitee-accepted-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/invitee-accepted-notification-item.js.es6
@@ -4,10 +4,7 @@ import { postUrl } from "discourse/lib/utilities";
 import { userPath } from "discourse/lib/url";
 
 createWidgetFrom(DefaultNotificationItem, "invitee-accepted-notification-item", {
-  url() {
-    const attrs = this.attrs;
-    const data = attrs.data;
-
+  url(data) {
     return userPath(data.display_username);
   },
 });
diff --git a/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6
index 324b5d6..a23e31c 100644
--- a/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/liked-consolidated-notification-item.js.es6
@@ -4,10 +4,7 @@ import { escapeExpression } from "discourse/lib/utilities";
 import { userPath } from "discourse/lib/url";
 
 createWidgetFrom(DefaultNotificationItem, "liked-consolidated-notification-item", {
-  url() {
-    const attrs = this.attrs;
-    const data = attrs.data;
-
+  url(data) {
     return userPath(
       `${this.attrs.username ||
         this.currentUser

GitHub sha: 86d5208b