Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactore: get the agreement statues from db instead of session #552

Merged
merged 9 commits into from
Dec 3, 2024

Conversation

xingwanying
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
petercat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 2:56am

Copy link

Walkthrough

This pull request refactors the process of retrieving agreement status by fetching it from the database instead of relying on session data. It introduces a new API endpoint to get the agreement status and updates the client-side logic to use this endpoint.

Changes

File Summary
client/app/factory/edit/page.tsx Updated to use useAgreementStatus hook to fetch agreement status from the database. Removed session-based logic for agreement status.
client/app/hooks/useAgreement.ts Added useAgreementStatus hook using useQuery to fetch agreement status.
client/app/services/UserController.ts Added getAgreementStatus function to call the new API endpoint for agreement status.
server/auth/router.py Added new API endpoint /agreement/status to fetch agreement status from the database. Refactored existing endpoint to use ProfilesDAO.
server/core/dao/profilesDAO.py Introduced ProfilesDAO class to interact with the database for agreement status.
server/core/models/profiles.py Added Profiles model to represent user profile data including agreement status.

server/auth/router.py Outdated Show resolved Hide resolved
@xingwanying xingwanying merged commit 11e80d1 into main Dec 3, 2024
3 of 4 checks passed
@xingwanying xingwanying deleted the fix_userinfo_session branch December 3, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant