diff --git a/client/pages/[username]/[slug]/index.tsx b/client/pages/[username]/[slug]/index.tsx index d7459f8c..e50b52c3 100644 --- a/client/pages/[username]/[slug]/index.tsx +++ b/client/pages/[username]/[slug]/index.tsx @@ -39,8 +39,6 @@ export const getServerSideProps: GetServerSideProps = async ({ query, loc try { const resume = await fetchResumeByIdentifier({ username, slug }); - console.log('Preview~getServerSideProps~resume', resume); - return { props: { username, slug, resume, ...(await serverSideTranslations(locale, ['common'])) }, }; @@ -63,8 +61,6 @@ const Preview: NextPage = ({ username, slug, resume: initialData }) => { }, [dispatch, initialData]); useEffect(() => { - console.log('Preview~useEffect~resume', resume); - const locale = get(resume, 'metadata.locale', 'en'); if (!isEmpty(resume) && router.locale !== locale) { diff --git a/client/services/resume.ts b/client/services/resume.ts index acaac0df..ba946435 100644 --- a/client/services/resume.ts +++ b/client/services/resume.ts @@ -64,10 +64,22 @@ export const fetchResumeByIdentifier = async ({ if (!isBrowser) { const secretKey = options.secretKey; - return axios.get(`/resume/${username}/${slug}`, { params: { secretKey } }).then((res) => res.data); + console.log('ResumeService~fetchResumeByIdentifier', 'isNotBrowser', username, slug, secretKey); + + const resume = axios.get(`/resume/${username}/${slug}`, { params: { secretKey } }).then((res) => res.data); + + console.log('ResumeService~fetchResumeByIdentifier', 'isNotBrowser', resume); + + return resume; } - return axios.get(`/resume/${username}/${slug}`).then((res) => res.data); + console.log('ResumeService~fetchResumeByIdentifier', 'isBrowser', username, slug); + + const resume = axios.get(`/resume/${username}/${slug}`).then((res) => res.data); + + console.log('ResumeService~fetchResumeByIdentifier', 'isBrowser', resume); + + return resume; }; export const fetchResumeByShortId = async ({ shortId }: FetchResumeByShortIdParams) => diff --git a/server/src/resume/resume.controller.ts b/server/src/resume/resume.controller.ts index 7f44762a..502b6340 100644 --- a/server/src/resume/resume.controller.ts +++ b/server/src/resume/resume.controller.ts @@ -56,6 +56,8 @@ export class ResumeController { @User('id') userId?: number, @Query('secretKey') secretKey?: string ) { + console.log('ResumeController~findOneByIdentifier', username, slug, userId, secretKey); + return this.resumeService.findOneByIdentifier(username, slug, userId, secretKey); } diff --git a/server/src/resume/resume.service.ts b/server/src/resume/resume.service.ts index 0393cb1e..6714848b 100644 --- a/server/src/resume/resume.service.ts +++ b/server/src/resume/resume.service.ts @@ -162,6 +162,8 @@ export class ResumeService { throw new HttpException('The resume you are looking does not exist, or maybe never did?', HttpStatus.NOT_FOUND); } + console.log('ResumeService~findOneByIdentifier', resume); + return resume; }