var CourseActions, CourseListingActions, CrudConfig, DELETED, DELETING, TeacherRosterConfig, _, actions, extendConfig, makeSimpleStore, ref, ref1, store;
ref = require('./helpers'), CrudConfig = ref.CrudConfig, makeSimpleStore = ref.makeSimpleStore, extendConfig = ref.extendConfig;
CourseActions = require('./course').CourseActions;
CourseListingActions = require('./course-listing').CourseListingActions;
_ = require('underscore');
DELETING = 'deleting';
DELETED = 'deleted';
TeacherRosterConfig = {
"delete": function(teacherId, courseId) {
this._asyncStatus[teacherId] = DELETING;
return this.emit(DELETING);
},
deleted: function(result, teacherId, courseId) {
this._asyncStatus[teacherId] = DELETED;
CourseListingActions["delete"](courseId);
return this.emit(DELETED);
},
exports: {
isDeleting: function(teacherId) {
return this._asyncStatus[teacherId] === DELETING;
}
}
};
extendConfig(TeacherRosterConfig, new CrudConfig());
ref1 = makeSimpleStore(TeacherRosterConfig), actions = ref1.actions, store = ref1.store;
module.exports = {
TeacherRosterActions: actions,
TeacherRosterStore: store
};
|