Don't inject kredits service in models
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
import EmberObject from '@ember/object';
|
||||
import { computed } from '@ember/object';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { inject as injectService } from '@ember/service';
|
||||
import bignumber from 'kredits-web/utils/cps/bignumber';
|
||||
|
||||
export default EmberObject.extend({
|
||||
kredits: injectService(),
|
||||
|
||||
// Contract
|
||||
id: bignumber('idRaw', 'toString'),
|
||||
creatorAccount: null,
|
||||
@@ -26,10 +22,4 @@ export default EmberObject.extend({
|
||||
details: {},
|
||||
url: null,
|
||||
ipfsData: '',
|
||||
|
||||
// Relationships
|
||||
// TODO: Optimize it. We don't need to find the contributor every time we add a new one
|
||||
contributor: computed('contributorId', 'kredits.contributors.[]', function() {
|
||||
return this.get('kredits.contributors').findBy('id', this.contributorId);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user