|
|
|
@ -4,6 +4,7 @@ import { RequestService } from "../../../../../services/request.service";
|
|
|
|
|
import { MessageService } from "../../../../../services";
|
|
|
|
|
import { MatDialog } from "@angular/material/dialog";
|
|
|
|
|
import { DenyDialogComponent } from "../../../shared/deny-dialog/deny-dialog.component";
|
|
|
|
|
import { RequestServiceV2 } from "../../../../../services/requestV2.service";
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
templateUrl: "./tv-requests-panel.component.html",
|
|
|
|
@ -16,7 +17,9 @@ export class TvRequestsPanelComponent {
|
|
|
|
|
|
|
|
|
|
public displayedColumns: string[] = ['number', 'title', 'airDate', 'status'];
|
|
|
|
|
|
|
|
|
|
constructor(private requestService: RequestService, private messageService: MessageService,
|
|
|
|
|
constructor(private requestService: RequestService,
|
|
|
|
|
private requestService2: RequestServiceV2,
|
|
|
|
|
private messageService: MessageService,
|
|
|
|
|
public dialog: MatDialog) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -83,9 +86,9 @@ export class TvRequestsPanelComponent {
|
|
|
|
|
width: '250px',
|
|
|
|
|
data: {requestId: request.id, requestType: RequestType.tvShow}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => {
|
|
|
|
|
request.denied = true;
|
|
|
|
|
request.denied = true;
|
|
|
|
|
request.seasonRequests.forEach((season) => {
|
|
|
|
|
season.episodes.forEach((ep) => {
|
|
|
|
|
ep.approved = false;
|
|
|
|
@ -93,4 +96,14 @@ export class TvRequestsPanelComponent {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public reProcessRequest(request: IChildRequests) {
|
|
|
|
|
this.requestService2.reprocessRequest(request.id, RequestType.tvShow).subscribe(result => {
|
|
|
|
|
if (result.result) {
|
|
|
|
|
this.messageService.send(result.message ? result.message : "Successfully Re-processed the request", "Ok");
|
|
|
|
|
} else {
|
|
|
|
|
this.messageService.send(result.errorMessage, "Ok");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|