🧪 Add testing page for overseerr request

This commit is contained in:
ajnart
2022-08-07 12:15:15 +02:00
parent 0e3c9e7ba8
commit 40a76593a2

22
src/pages/tryrequest.tsx Normal file
View File

@@ -0,0 +1,22 @@
import axios from 'axios';
import { useEffect, useState } from 'react';
import RequestModal from '../modules/overseerr/RequestModal';
export default function TryRequest(props: any) {
const [OverseerrResults, setOverseerrResults] = useState<any[]>([]);
useEffect(() => {
// Use the overseerr API get the media info.
axios
.get('/api/modules/overseerr?query=Lucifer')
.then((res) => {
setOverseerrResults(res.data.results);
})
.catch((err) => {
throw err;
});
}, [props]);
if (!OverseerrResults || OverseerrResults.length === 0) {
return null;
}
return <RequestModal base={OverseerrResults[0]} />;
}