fix(frontend): canceled movie request should set parent movie status back to unknown (#198)

pull/202/head
Alex Zoitos 4 years ago committed by GitHub
parent 2e599f235b
commit 139871f218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -163,16 +163,16 @@ export class MediaRequest {
}
const seasonRequestRepository = getRepository(SeasonRequest);
if (this.status === MediaRequestStatus.APPROVED) {
this.media.status = MediaStatus.PROCESSING;
mediaRepository.save(this.media);
media.status = MediaStatus.PROCESSING;
mediaRepository.save(media);
}
if (
this.media.mediaType === MediaType.MOVIE &&
this.status === MediaRequestStatus.DECLINED
) {
this.media.status = MediaStatus.UNKNOWN;
mediaRepository.save(this.media);
media.status = MediaStatus.UNKNOWN;
mediaRepository.save(media);
}
/**
@ -213,7 +213,7 @@ export class MediaRequest {
});
if (!fullMedia.requests || fullMedia.requests.length === 0) {
fullMedia.status = MediaStatus.UNKNOWN;
mediaRepository.save(this.media);
mediaRepository.save(fullMedia);
}
}

@ -99,7 +99,7 @@ const MovieRequestModal: React.FC<RequestModalProps> = ({
}
addToast(
<span>
{intl.formatMessage(messages.cancelrequest, {
{intl.formatMessage(messages.requestCancel, {
title: data?.title,
strong: function strong(msg) {
return <strong>{msg}</strong>;

@ -209,7 +209,8 @@ const TitleCard: React.FC<TitleCardProps> = ({
</svg>
</a>
</Link>
{!currentStatus && (
{(!currentStatus ||
currentStatus === MediaStatus.UNKNOWN) && (
<button
onClick={() => setShowRequestModal(true)}
className="w-full h-7 text-center text-white bg-indigo-500 rounded-sm ml-2 hover:bg-indigo-400 focus:border-indigo-700 focus:ring-indigo active:bg-indigo-700 transition ease-in-out duration-150"

Loading…
Cancel
Save