🧪 Add testing page for overseerr request
This commit is contained in:
22
src/pages/tryrequest.tsx
Normal file
22
src/pages/tryrequest.tsx
Normal 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]} />;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user