#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 { export interface ISearchTvResult {
id: number; id: number;
@ -21,7 +21,7 @@ export interface ISearchTvResult {
siteRating: number; siteRating: number;
trailer: string; trailer: string;
homepage: string; homepage: string;
seasonsRequests: ISeasonRequests[]; seasonRequests: INewSeasonRequests[];
requestAll: boolean; requestAll: boolean;
approved: boolean; approved: boolean;
requested: boolean; requested: boolean;

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