File tree Expand file tree Collapse file tree 1 file changed +0
-29
lines changed
Expand file tree Collapse file tree 1 file changed +0
-29
lines changed Original file line number Diff line number Diff 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 : {
You can’t perform that action at this time.
0 commit comments