Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Remove unneeded promise wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed Oct 4, 2016
1 parent b7353b4 commit ceafc99
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions app/mixins/patient-visits.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import Ember from 'ember';
import PouchDbMixin from 'hospitalrun/mixins/pouchdb';
export default Ember.Mixin.create(PouchDbMixin, {
getPatientVisits: function(patient) {
return new Ember.RSVP.Promise(function(resolve, reject) {
var maxValue = this.get('maxValue'),
patientId = patient.get('id');
this.store.query('visit', {
options: {
startkey: [patientId, null, null, null, 'visit_'],
endkey: [patientId, maxValue, maxValue, maxValue, maxValue]
},
mapReduce: 'visit_by_patient'
}).then(resolve, reject);
}.bind(this));
var maxValue = this.get('maxValue'),
patientId = patient.get('id');
return this.store.query('visit', {
options: {
startkey: [patientId, null, null, null, 'visit_'],
endkey: [patientId, maxValue, maxValue, maxValue, maxValue]
},
mapReduce: 'visit_by_patient',
debug: true
});
}
});

0 comments on commit ceafc99

Please sign in to comment.