Resume Craft: Your go-to platform for effortlessly tailoring ATS-friendly resumes to job descriptions. Streamline your job application process and stand out in the competitive market.
This pull request includes several changes to improve the handling of user data and optimize the use of the useEffect hook across the codebase. The most important changes are the addition of user data fetching, updates to the useEffect hook to include dependency arrays, and modifications to the resume service to accept optional user data.
src/lib/services/resume-service.ts: Modified getResumeFormData to accept an optional userData parameter, reducing the need for additional API calls if user data is already available.
Removed unnecessary useEffect dependencies across multiple components to ensure proper effect execution. [1][2][3][4]
Testing done
Screenshots / Videos
Checklist:
[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
Issue:
Summary
This pull request includes several changes to improve the handling of user data and optimize the use of the
useEffect
hook across the codebase. The most important changes are the addition of user data fetching, updates to theuseEffect
hook to include dependency arrays, and modifications to the resume service to accept optional user data.Details
Data Fetching Enhancements:
src/lib/utils/firebase/database/users.ts
: Added a new functiongetUserData
to fetch user data from the database.src/app/(enter-data)/enter-data/page.tsx
: IntegratedgetUserData
to fetch user data before callinggetResumeFormData
. [1] [2]src/app/(generate-resume)/generate-resume/[slug]/page.tsx
: Updated to fetch user data and pass it togetResumeFormData
for both base and variant resumes. (src/app/(generate-resume)/generate-resume/[slug]/page.tsxL85-R93, src/app/(generate-resume)/generate-resume/[slug]/page.tsxL98-R117)State Management Improvements:
src/app/(generate-resume)/generate-resume/[slug]/page.tsx
: Added state management foruserData
and included a check for user credits before proceeding with resume generation. (src/app/(generate-resume)/generate-resume/[slug]/page.tsxR49, src/app/(generate-resume)/generate-resume/[slug]/page.tsxR143-R150)Code Simplification:
src/lib/services/resume-service.ts
: ModifiedgetResumeFormData
to accept an optionaluserData
parameter, reducing the need for additional API calls if user data is already available.useEffect
dependencies across multiple components to ensure proper effect execution. [1] [2] [3] [4]Testing done
Screenshots / Videos
Checklist: