|
|
|
@ -6,7 +6,7 @@ import { Observable } from "rxjs";
|
|
|
|
|
|
|
|
|
|
import { TreeNode } from "primeng/primeng";
|
|
|
|
|
import { IRequestEngineResult } from "../interfaces";
|
|
|
|
|
import { IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, IMovieUpdateModel, IRequestsViewModel, ITvRequests,ITvUpdateModel, OrderType } from "../interfaces";
|
|
|
|
|
import { IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, IMovieUpdateModel, IRequestsViewModel, ITvRequests, ITvUpdateModel, OrderType } from "../interfaces";
|
|
|
|
|
import { ITvRequestViewModel } from "../interfaces";
|
|
|
|
|
import { ServiceHelpers } from "./service.helpers";
|
|
|
|
|
|
|
|
|
@ -22,8 +22,8 @@ export class RequestService extends ServiceHelpers {
|
|
|
|
|
|
|
|
|
|
public getTotalMovies(): Observable<number> {
|
|
|
|
|
return this.http.get<number>(`${this.url}Movie/total`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getTotalTv(): Observable<number> {
|
|
|
|
|
return this.http.get<number>(`${this.url}tv/total`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
@ -87,7 +87,7 @@ export class RequestService extends ServiceHelpers {
|
|
|
|
|
public removeTvRequest(request: ITvRequests) {
|
|
|
|
|
this.http.delete(`${this.url}tv/${request.id}`, {headers: this.headers}).subscribe();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public markTvAvailable(movie: ITvUpdateModel): Observable<IRequestEngineResult> {
|
|
|
|
|
return this.http.post<IRequestEngineResult>(`${this.url}tv/available`, JSON.stringify(movie), {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
@ -102,11 +102,11 @@ export class RequestService extends ServiceHelpers {
|
|
|
|
|
|
|
|
|
|
public updateChild(child: IChildRequests): Observable<IChildRequests> {
|
|
|
|
|
return this.http.put<IChildRequests>(`${this.url}tv/child`, JSON.stringify(child), {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public denyChild(child: ITvUpdateModel): Observable<IRequestEngineResult> {
|
|
|
|
|
return this.http.put<IRequestEngineResult>(`${this.url}tv/deny`, JSON.stringify(child), {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public approveChild(child: ITvUpdateModel): Observable<IRequestEngineResult> {
|
|
|
|
|
return this.http.post<IRequestEngineResult>(`${this.url}tv/approve`, JSON.stringify(child), {headers: this.headers});
|
|
|
|
@ -114,16 +114,16 @@ export class RequestService extends ServiceHelpers {
|
|
|
|
|
public deleteChild(child: IChildRequests): Observable<boolean> {
|
|
|
|
|
return this.http.delete<boolean>(`${this.url}tv/child/${child.id}`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public subscribeToMovie(requestId: number): Observable<boolean> {
|
|
|
|
|
return this.http.post<boolean>(`${this.url}movie/subscribe/${requestId}`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public unSubscribeToMovie(requestId: number): Observable<boolean> {
|
|
|
|
|
return this.http.post<boolean>(`${this.url}movie/unsubscribe/${requestId}`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
public subscribeToTv(requestId: number): Observable<boolean> {
|
|
|
|
|
return this.http.post<boolean>(`${this.url}tv/subscribe/${requestId}`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public unSubscribeToTv(requestId: number): Observable<boolean> {
|
|
|
|
|
return this.http.post<boolean>(`${this.url}tv/unsubscribe/${requestId}`, {headers: this.headers});
|
|
|
|
|
}
|
|
|
|
|