push a bunch of console.logs

This commit is contained in:
Amruth Pillai
2022-11-24 21:45:42 +01:00
parent 6ee290a625
commit ebe13fa82e
4 changed files with 18 additions and 6 deletions

View File

@ -39,8 +39,6 @@ export const getServerSideProps: GetServerSideProps<Props> = async ({ query, loc
try { try {
const resume = await fetchResumeByIdentifier({ username, slug }); const resume = await fetchResumeByIdentifier({ username, slug });
console.log('Preview~getServerSideProps~resume', resume);
return { return {
props: { username, slug, resume, ...(await serverSideTranslations(locale, ['common'])) }, props: { username, slug, resume, ...(await serverSideTranslations(locale, ['common'])) },
}; };
@ -63,8 +61,6 @@ const Preview: NextPage<Props> = ({ username, slug, resume: initialData }) => {
}, [dispatch, initialData]); }, [dispatch, initialData]);
useEffect(() => { useEffect(() => {
console.log('Preview~useEffect~resume', resume);
const locale = get(resume, 'metadata.locale', 'en'); const locale = get(resume, 'metadata.locale', 'en');
if (!isEmpty(resume) && router.locale !== locale) { if (!isEmpty(resume) && router.locale !== locale) {

View File

@ -64,10 +64,22 @@ export const fetchResumeByIdentifier = async ({
if (!isBrowser) { if (!isBrowser) {
const secretKey = options.secretKey; const secretKey = options.secretKey;
return axios.get<Resume>(`/resume/${username}/${slug}`, { params: { secretKey } }).then((res) => res.data); console.log('ResumeService~fetchResumeByIdentifier', 'isNotBrowser', username, slug, secretKey);
const resume = axios.get<Resume>(`/resume/${username}/${slug}`, { params: { secretKey } }).then((res) => res.data);
console.log('ResumeService~fetchResumeByIdentifier', 'isNotBrowser', resume);
return resume;
} }
return axios.get<Resume>(`/resume/${username}/${slug}`).then((res) => res.data); console.log('ResumeService~fetchResumeByIdentifier', 'isBrowser', username, slug);
const resume = axios.get<Resume>(`/resume/${username}/${slug}`).then((res) => res.data);
console.log('ResumeService~fetchResumeByIdentifier', 'isBrowser', resume);
return resume;
}; };
export const fetchResumeByShortId = async ({ shortId }: FetchResumeByShortIdParams) => export const fetchResumeByShortId = async ({ shortId }: FetchResumeByShortIdParams) =>

View File

@ -56,6 +56,8 @@ export class ResumeController {
@User('id') userId?: number, @User('id') userId?: number,
@Query('secretKey') secretKey?: string @Query('secretKey') secretKey?: string
) { ) {
console.log('ResumeController~findOneByIdentifier', username, slug, userId, secretKey);
return this.resumeService.findOneByIdentifier(username, slug, userId, secretKey); return this.resumeService.findOneByIdentifier(username, slug, userId, secretKey);
} }

View File

@ -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); 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; return resume;
} }