-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
BackendBackend Related IssueBackend Related IssueFrontendFrontend Related IssueFrontend Related IssueRefactorCode ImprovementCode Improvement🌱Nice-to-HaveEnhancements, Refactors, UI tweaks, or non-critical optimizationsEnhancements, Refactors, UI tweaks, or non-critical optimizations
Milestone
Description
Standardize the Profile and Contacts flows with shared Zod schemas, typed TanStack Query hooks, and a unified form structure. This improves type safety, form consistency, and long-term maintainability.
🎯 Goals
- Refactor name and password update flows to use Zod + RHF
- Replace legacy
useSession()anduseEffectlogic withuseQuery-based data access - Introduce type-safe fetching of contact/visitor info via React Query
- Prepare mutation hooks for future contact update/delete support
🔧 Tasks
- Migrate name and password form logic to use
useFormWithSchema()withprofileSchemas.ts - Remove reliance on
useSession()for form pre-fill; useuseProfileQuery()instead - Implement and connect the following TanStack hooks:
useProfileQueryuseUpdateNameMutationuseUpdatePasswordMutation
- Add
contactSchemas.tsfor contact models and future visitor info structures - Implement
useContactsQueryand confirm server typings align with Zod types - Refactor frontend contact views to consume the typed query
- Ensure all submit buttons are disabled unless form is dirty + valid
- Replace any raw Axios/fetch calls in the above flows with the new hooks
✅ Acceptance Criteria
- Forms for name and password updates are fully validated via RHF + Zod
- Contact info is fetched using typed query hooks
- No usage of
useSession()remains in form logic - All APIs throw typed Zod errors and display them using our toast or inline error components
- Manual testing completed for various session modes and edge cases
🧠Notes
- Mutations for updating or deleting contacts will be added later as needed
- Enums such as
UserRoleshould be used in schema validation where applicable
Metadata
Metadata
Assignees
Labels
BackendBackend Related IssueBackend Related IssueFrontendFrontend Related IssueFrontend Related IssueRefactorCode ImprovementCode Improvement🌱Nice-to-HaveEnhancements, Refactors, UI tweaks, or non-critical optimizationsEnhancements, Refactors, UI tweaks, or non-critical optimizations