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

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

@ -209,7 +209,8 @@ const TitleCard: React.FC<TitleCardProps> = ({
</svg> </svg>
</a> </a>
</Link> </Link>
{!currentStatus && ( {(!currentStatus ||
currentStatus === MediaStatus.UNKNOWN) && (
<button <button
onClick={() => setShowRequestModal(true)} 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" 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