Created
April 11, 2017 22:11
-
-
Save falonofthetower/f2c8c007c6297461683b64279bc7dc98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { inject: { service }, Component } = Ember; | |
export default Component.extend({ | |
session: service('session'), | |
currentUser: service('currentUser'), | |
myAssignments: Ember.computed.filter('assignments', function(assignment) { | |
let user = this.get('currentUser').user; | |
return assignment.get('assignee').then((assignee) => { | |
assignee.get('id') === user.id; | |
}); | |
}), | |
requestedAssignments: Ember.computed.filter('myAssignments', function(assignment) { | |
return assignment.get('status') === "requested"; | |
}), | |
pendingAssignments: Ember.computed.filter('[email protected]', function(assignment) { | |
return assignment.get('status') === "pending"; | |
}), | |
closedAssignments: Ember.computed.filter('[email protected]', function(assignment) { | |
return assignment.get('status') === "accepted"; | |
}), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment