#1513 !wip when we request episodes then it will show as pending approval if the request was successful

pull/1520/head
Jamie.Rees 7 years ago
parent d0a7ef9223
commit 6e7e1e4660

@ -1,4 +1,4 @@
import { ISeasonRequests } from "./IRequestModel";
import { INewSeasonRequests } from "./IRequestModel";
export interface ISearchTvResult {
id: number;
@ -21,7 +21,7 @@ export interface ISearchTvResult {
siteRating: number;
trailer: string;
homepage: string;
seasonsRequests: ISeasonRequests[];
seasonRequests: INewSeasonRequests[];
requestAll: boolean;
approved: boolean;
requested: boolean;

@ -42,12 +42,20 @@ export class SeriesInformationComponent implements OnInit, OnDestroy {
this.requestService.requestTv(this.series)
.takeUntil(this.subscriptions)
.subscribe(x => {
debugger;
this.result = x as IRequestEngineResult;
if (this.result.requestAdded) {
this.notificationService.success("Request Added",
`Request for ${this.series.title} has been added successfully`);
this.series.seasonRequests.forEach((season) => {
season.episodes.forEach((ep) => {
ep.selected = false;
});
});
} else {
this.notificationService.warning("Request Added", this.result.message);
this.notificationService.warning("Request Added", this.result.errorMessage ? this.result.errorMessage : this.result.message);
}
});
}

Loading…
Cancel
Save