Allow FIELDS_IDS to be overridden

This commit is contained in:
David Taylor 2018-03-28 22:02:34 +01:00 committed by Sam
parent 70e60f4afe
commit 37fe1c76b9
1 changed files with 3 additions and 2 deletions

View File

@ -2,10 +2,11 @@ import RestModel from 'discourse/models/rest';
import { default as computed } from 'ember-addons/ember-computed-decorators';
const THEME_UPLOAD_VAR = 2;
const FIELDS_IDS = [0, 1];
const Theme = RestModel.extend({
FIELDS_IDS: [0, 1],
@computed('theme_fields')
themeFields(fields) {
@ -16,7 +17,7 @@ const Theme = RestModel.extend({
let hash = {};
fields.forEach(field => {
if (!field.type_id || FIELDS_IDS.includes(field.type_id)) {
if (!field.type_id || this.get('FIELDS_IDS').includes(field.type_id)) {
hash[this.getKey(field)] = field;
}
});