chore: 🤖 add computed displayName to fallback on id for models
This commit is contained in:
8 files changed
+33
-6
No files matched your search
@@ -4,6 +4,16 @@ import { computed } from '@ember/object';
|
||||
export default class BaseModel extends Model {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Names are optional on models in our API. Thus we need to fallback on ID
|
||||
* for display purposes.
|
||||
* @type {string}
|
||||
*/
|
||||
@computed('name', 'id')
|
||||
get displayName() {
|
||||
return this.name || this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user