attempt to fix locale issue

This commit is contained in:
Amruth Pillai
2022-11-24 15:40:49 +01:00
parent 2e62eea351
commit 69a5276614

View File

@ -27,7 +27,7 @@ type Props = {
export const getServerSideProps: GetServerSideProps<Props | Promise<Props>, QueryParams> = async ({
query,
locale,
locale = 'en',
}) => {
const { username, slug, secretKey } = query as QueryParams;
@ -35,7 +35,7 @@ export const getServerSideProps: GetServerSideProps<Props | Promise<Props>, Quer
if (isEmpty(secretKey)) throw new Error('There is no secret key!');
const resume = await fetchResumeByIdentifier({ username, slug, options: { secretKey } });
const displayLocale = get(resume, 'metadata.locale') ?? locale ?? 'en';
const displayLocale = get(resume, 'metadata.locale') ?? locale;
return {
props: {