REFACTOR: Remove Discourse.TrustLevel constant

This commit is contained in:
Robin Ward 2019-11-07 15:25:58 -05:00
parent f8d69253e8
commit 9d457fa51f
3 changed files with 3 additions and 4 deletions

View File

@ -49,6 +49,7 @@
//= require ./discourse/models/permission-type
//= require ./discourse/models/user-action-group
//= require ./discourse/models/input-validation
//= require ./discourse/models/trust-level
//= require ./discourse/lib/search
//= require ./discourse/lib/user-search
//= require ./discourse/lib/export-csv

View File

@ -7,6 +7,7 @@ import Archetype from "discourse/models/archetype";
import PostActionType from "discourse/models/post-action-type";
import Singleton from "discourse/mixins/singleton";
import RestModel from "discourse/models/rest";
import TrustLevel from "discourse/models/trust-level";
import PreloadStore from "preload-store";
const Site = RestModel.extend({
@ -176,9 +177,7 @@ Site.reopenClass(Singleton, {
}
if (result.trust_levels) {
result.trustLevels = result.trust_levels.map(tl =>
Discourse.TrustLevel.create(tl)
);
result.trustLevels = result.trust_levels.map(tl => TrustLevel.create(tl));
delete result.trust_levels;
}

View File

@ -89,7 +89,6 @@ JS
"discourse/models/user-action",
"discourse/routes/discourse",
"discourse/models/category",
"discourse/models/trust-level",
"discourse/models/site",
"discourse/models/user",
"discourse/models/session",