Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove unused `User` methods (#22347)

Jarek Radosza7421d367532
diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js
index b861f48564f..3bf74e96858 100644
--- a/app/assets/javascripts/discourse/app/models/user.js
+++ b/app/assets/javascripts/discourse/app/models/user.js
@@ -437,10 +437,6 @@ const User = RestModel.extend({
});
},
- copy() {
- return User.create(this.getProperties(Object.keys(this)));
- },
-
save(fields) {
const data = this.getProperties(
userFields.filter((uf) => !fields || fields.includes(uf))
@@ -682,11 +678,6 @@ const User = RestModel.extend({
return groups.length === 0 ? null : groups;
},
- @discourseComputed("filteredGroups", "numGroupsToDisplay")
- showMoreGroupsLink(filteredGroups, numGroupsToDisplay) {
- return filteredGroups.length > numGroupsToDisplay;
- },
-
// NOTE: This only includes groups *visible* to the user via the serializer,
// so be wary when using this.
isInAnyGroups(groupIds) {
@@ -840,17 +831,6 @@ const User = RestModel.extend({
});
},
- generateMultipleUseInviteLink(
- group_ids,
- max_redemptions_allowed,
- expires_at
- ) {
- return ajax("/invites", {
- type: "POST",
- data: { group_ids, max_redemptions_allowed, expires_at },
- });
- },
-
@dependentKeyCompat
get mutedCategories() {
return Category.findByIds(this.get("muted_category_ids"));
@@ -1380,9 +1360,7 @@ User.reopenClass(Singleton, {
data: { timezone: user.user_option.timezone },
});
},
-});
-User.reopenClass({
create(args) {
args = args || {};
this.deleteStatusTrackingFields(args);