File tree Expand file tree Collapse file tree
client/app/components/home Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ export class CoursesComponent implements OnInit {
3737 if ( params . id == "me" ) {
3838 this . requestCoursesByUser ( ) ;
3939 }
40+ if ( params . id == "highlights" ) {
41+ this . requestCoursesByHighlights ( ) ;
42+ }
4043 else {
4144 this . requestCoursesByCategory ( params . id ) ;
4245 }
@@ -71,4 +74,16 @@ export class CoursesComponent implements OnInit {
7174 } ) ;
7275 }
7376
77+ requestCoursesByHighlights ( ) :void {
78+ this . headerText = "Highlights" ;
79+ this . courses = [ ] ;
80+ this . coursesService . getCoursesByHighlight ( ) . subscribe ( response => {
81+ this . courses . push ( response ) ;
82+ if ( response . name != "HttpResponseError" ) {
83+ this . dataIsAvailable = true ;
84+ this . courses = response ;
85+ }
86+ } ) ;
87+ }
88+
7489}
Original file line number Diff line number Diff line change @@ -35,6 +35,18 @@ export class CoursesService {
3535 ) ;
3636 }
3737
38+ getCoursesByHighlight ( ) : Observable < any > {
39+ return this . http . get ( this . url + "/courses/highlights" , this . httpOptions ) . pipe (
40+ map ( ( res : Response ) => {
41+ return res ;
42+ } ) ,
43+ catchError ( ( err : HttpErrorResponse ) => {
44+ this . alertService . push ( err ) ;
45+ return of ( err ) ;
46+ } )
47+ ) ;
48+ }
49+
3850 applyToCourse ( courseId : String ) : Observable < any > {
3951 return this . http . post ( this . url + "/courses/" + courseId + "/apply" , "" , this . httpOptions ) . pipe (
4052 map ( ( res : Response ) => {
Original file line number Diff line number Diff line change 2222 Kurs Kategorien
2323</ div >
2424
25- < div class ="menuPoint " [routerLink] ="['aktuelles '] " (click) ="routing() ">
25+ < div class ="menuPoint " [routerLink] ="['kurs-uebersicht/highlights '] " (click) ="routing() ">
2626 < span class ="icon ">
2727 < i class ="fa fa-calendar "> </ i >
2828 </ span >
29- Aktuelles
29+ Highlights
3030</ div >
3131
3232< div class ="menuPoint " [routerLink] ="['kontakt'] " (click) ="routing() ">
You can’t perform that action at this time.
0 commit comments