You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
overseerr/src/pages/collection/[collectionId]/index.tsx

36 lines
917 B

import CollectionDetails from '@app/components/CollectionDetails';
import type { Collection } from '@server/models/Collection';
import axios from 'axios';
import type { GetServerSideProps, NextPage } from 'next';
interface CollectionPageProps {
collection?: Collection;
}
const CollectionPage: NextPage<CollectionPageProps> = ({ collection }) => {
return <CollectionDetails collection={collection} />;
};
export const getServerSideProps: GetServerSideProps<
CollectionPageProps
> = async (ctx) => {
const response = await axios.get<Collection>(
`http://${process.env.HOST || 'localhost'}:${process.env.PORT || 5055}/api/v1/collection/${
ctx.query.collectionId
}`,
{
headers: ctx.req?.headers?.cookie
? { cookie: ctx.req.headers.cookie }
: undefined,
}
);
return {
props: {
collection: response.data,
},
};
};
export default CollectionPage;