mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-08 15:48:08 -05:00
feat: add server default locale setting (#1536)
* feat: add server default locale setting * fix: do not modify defaultLocale property of IntlProvider
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import React from 'react';
|
||||
import { GetServerSideProps, NextPage } from 'next';
|
||||
import type { Collection } from '../../../../server/models/Collection';
|
||||
import axios from 'axios';
|
||||
import { parseCookies } from 'nookies';
|
||||
import { GetServerSideProps, NextPage } from 'next';
|
||||
import React from 'react';
|
||||
import type { Collection } from '../../../../server/models/Collection';
|
||||
import CollectionDetails from '../../../components/CollectionDetails';
|
||||
|
||||
interface CollectionPageProps {
|
||||
@@ -16,11 +15,10 @@ const CollectionPage: NextPage<CollectionPageProps> = ({ collection }) => {
|
||||
export const getServerSideProps: GetServerSideProps<CollectionPageProps> = async (
|
||||
ctx
|
||||
) => {
|
||||
const cookies = parseCookies(ctx);
|
||||
const response = await axios.get<Collection>(
|
||||
`http://localhost:${process.env.PORT || 5055}/api/v1/collection/${
|
||||
ctx.query.collectionId
|
||||
}${cookies.locale ? `?language=${cookies.locale}` : ''}`,
|
||||
}`,
|
||||
{
|
||||
headers: ctx.req?.headers?.cookie
|
||||
? { cookie: ctx.req.headers.cookie }
|
||||
|
||||
Reference in New Issue
Block a user