-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7900b3c
commit 9204fee
Showing
41 changed files
with
516 additions
and
585 deletions.
There are no files selected for viewing
13 changes: 11 additions & 2 deletions
13
src/Application/Features/Courses/Commands/PublishCourse/PublishCourse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,30 @@ | ||
import {Injectable, OnDestroy, inject} from '@angular/core'; | ||
import {HttpClient, HttpResponse} from '@angular/common/http'; | ||
import {environment} from '../../../../environments/environment'; | ||
import { Injectable, OnDestroy, inject } from '@angular/core'; | ||
import { HttpClient, HttpResponse } from '@angular/common/http'; | ||
import { environment } from '../../../../environments/environment'; | ||
import { catchError, map, shareReplay, switchMap } from 'rxjs/operators'; | ||
import { tap } from 'rxjs/operators'; | ||
import {BehaviorSubject, Observable, Observer, forkJoin, of} from 'rxjs'; | ||
import { BehaviorSubject, Observable, Observer, forkJoin, of } from 'rxjs'; | ||
import { AuthResponse } from '../models/login'; | ||
import { Register } from '../models/register'; | ||
import { Course } from 'src/app/modules/management/models/course'; | ||
import { AuthService } from './auth.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
providedIn: 'root', | ||
}) | ||
|
||
|
||
|
||
export class UserService { | ||
|
||
|
||
constructor(private _http: HttpClient, private authService: AuthService) { | ||
|
||
|
||
|
||
} | ||
|
||
|
||
public loadWishList(userId: string): Observable<Course[]> { | ||
return this._http.get<{ courses: Course[] }>(`${environment.baseUrl}/courses/${userId}/wishlist`) | ||
.pipe( | ||
map(response => response.courses), | ||
catchError(error => { | ||
console.error('HTTP request error:', error); | ||
return of([]); // Return an empty array in case of an error | ||
}) | ||
); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
constructor(private _http: HttpClient, private authService: AuthService) {} | ||
|
||
public loadWishList(userId: string): Observable<Course[]> { | ||
return this._http | ||
.get<{ courses: Course[] }>( | ||
`${environment.baseUrl}/courses/${userId}/wishlist` | ||
) | ||
.pipe( | ||
map((response) => response.courses), | ||
catchError((error) => { | ||
return of([]); // Return an empty array in case of an error | ||
}) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.