|
|
@ -3,7 +3,7 @@ import axios from 'axios';
|
|
|
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
|
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
|
|
import { defineMessages, useIntl } from 'react-intl';
|
|
|
|
import { defineMessages, useIntl } from 'react-intl';
|
|
|
|
import { useToasts } from 'react-toast-notifications';
|
|
|
|
import { useToasts } from 'react-toast-notifications';
|
|
|
|
import useSWR from 'swr';
|
|
|
|
import useSWR, { mutate } from 'swr';
|
|
|
|
import { MediaStatus } from '../../../server/constants/media';
|
|
|
|
import { MediaStatus } from '../../../server/constants/media';
|
|
|
|
import type { MediaRequest } from '../../../server/entity/MediaRequest';
|
|
|
|
import type { MediaRequest } from '../../../server/entity/MediaRequest';
|
|
|
|
import type { QuotaResponse } from '../../../server/interfaces/api/userInterfaces';
|
|
|
|
import type { QuotaResponse } from '../../../server/interfaces/api/userInterfaces';
|
|
|
@ -95,6 +95,7 @@ const MovieRequestModal = ({
|
|
|
|
is4k,
|
|
|
|
is4k,
|
|
|
|
...overrideParams,
|
|
|
|
...overrideParams,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
mutate('/api/v1/request?filter=all&take=10&sort=modified&skip=0');
|
|
|
|
|
|
|
|
|
|
|
|
if (response.data) {
|
|
|
|
if (response.data) {
|
|
|
|
if (onComplete) {
|
|
|
|
if (onComplete) {
|
|
|
@ -138,6 +139,7 @@ const MovieRequestModal = ({
|
|
|
|
const response = await axios.delete<MediaRequest>(
|
|
|
|
const response = await axios.delete<MediaRequest>(
|
|
|
|
`/api/v1/request/${editRequest?.id}`
|
|
|
|
`/api/v1/request/${editRequest?.id}`
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
mutate('/api/v1/request?filter=all&take=10&sort=modified&skip=0');
|
|
|
|
|
|
|
|
|
|
|
|
if (response.status === 204) {
|
|
|
|
if (response.status === 204) {
|
|
|
|
if (onComplete) {
|
|
|
|
if (onComplete) {
|
|
|
@ -174,6 +176,7 @@ const MovieRequestModal = ({
|
|
|
|
if (alsoApproveRequest) {
|
|
|
|
if (alsoApproveRequest) {
|
|
|
|
await axios.post(`/api/v1/request/${editRequest?.id}/approve`);
|
|
|
|
await axios.post(`/api/v1/request/${editRequest?.id}/approve`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mutate('/api/v1/request?filter=all&take=10&sort=modified&skip=0');
|
|
|
|
|
|
|
|
|
|
|
|
addToast(
|
|
|
|
addToast(
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|