Skip to content

Commit 69d8773

Browse files
committed
Preparing repo for reactive publish subscribe (#96)
Revert "Preparing repo for reactive publish subscribe" (#98)
1 parent a6ab1a8 commit 69d8773

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

collections/courses.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,6 @@ courses.allow({
2424
declare var SimpleSchema: any;
2525

2626
if (Meteor.isServer){
27-
Meteor.publish('user-courses', function() {
28-
if(this.userId) {
29-
let courseRecords = course_records.find({ user_id: this.userId });
30-
let courseIds = courseRecords.map(function(cr) {
31-
return (<any>cr).course_id;
32-
});
33-
const query = {
34-
'_id': {
35-
$in: courseIds
36-
}
37-
};
38-
return courses.find(query);
39-
}
40-
else {
41-
return null;
42-
}
43-
});
44-
Meteor.publish('all-courses', function() {
45-
if(this.userId !== "undefined") {
46-
const MAX_COURSES = 10;
47-
const query = {
48-
49-
};
50-
const options = {
51-
limit: MAX_COURSES
52-
};
53-
return courses.find(query, options);
54-
}
55-
});
5627
Meteor.startup(function(){
5728
var courseSchema = new SimpleSchema({
5829
course_name: {

0 commit comments

Comments
 (0)