Small fix when denying a request with a reason, we wasn't updating the ui

pull/2754/head
TidusJar 6 years ago
parent 1f59693c7e
commit 3e4b2a8e9f

@ -326,6 +326,7 @@ namespace Ombi.Core.Engine
return new RequestEngineResult
{
Result = true,
Message = "Request successfully deleted",
};
}

@ -87,9 +87,6 @@
<span *ngIf="request.approved && !request.available" id="processingRequestLabel" class="label label-info"
[translate]="'Common.ProcessingRequest'"></span>
<span *ngIf="request.denied" class="label label-danger" id="requestDeclinedLabel" [translate]="'Common.RequestDenied'"></span>
<span *ngIf="request.deniedReason" title="{{request.deniedReason}}">
<i class="fa fa-info-circle"></i>
</span>
<span *ngIf="!request.approved && !request.availble && !request.denied" id="pendingApprovalLabel"
class="label label-warning" [translate]="'Common.PendingApproval'"></span>

@ -135,15 +135,20 @@ export class MovieRequestsComponent implements OnInit {
public deny(request: IMovieRequests) {
this.requestToDeny = request;
this.denyDisplay = true;
}
}
public denyRequest() {
this.requestService.denyMovie({ id: this.requestToDeny.id, reason: this.rejectionReason })
.subscribe(x => {
debugger;
this.denyDisplay = false;
if (x.result) {
this.notificationService.success(
`Request for ${this.requestToDeny.title} has been denied successfully`);
const index = this.movieRequests.indexOf(this.requestToDeny, 0);
if (index > -1) {
this.movieRequests[index].denied = true;
}
} else {
this.notificationService.warning("Request Denied", x.message ? x.message : x.errorMessage);
this.requestToDeny.denied = false;

Loading…
Cancel
Save