Skip to content

feat: connect onboarding frontend to PUT /users/:id/onboard endpoint#467

Open
tars919 wants to merge 2 commits intomainfrom
tarika/onboarding-frontend-api
Open

feat: connect onboarding frontend to PUT /users/:id/onboard endpoint#467
tars919 wants to merge 2 commits intomainfrom
tarika/onboarding-frontend-api

Conversation

@tars919
Copy link
Copy Markdown
Contributor

@tars919 tars919 commented Apr 17, 2026

Description

Connects the onboarding frontend to the PUT /users/:id/onboard backend endpoint. When a user completes the last step and clicks "Go to Dashboard" or "Skip for now", their onboarding data is submitted and they're redirected to /.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (code improvement without changing functionality)
  • Documentation update
  • Configuration/infrastructure change
  • Performance improvement
  • Test coverage improvement

Related Issue(s)

Closes #
Related to #

What Changed?

  • Wired OnboardingPage.tsx to call PUT /users/:id/onboard on final step submission
  • Used useAuth directly instead of the Orval-generated hook — onboarding runs before setConfig is called by StartupProvider, so useCustomInstance would throw on mount
  • Updated InviteTeamStep to accept onNext and isSubmitting props and wired both action buttons to call onNext
  • Exported usePutUsersIdOnboard from @shared for future use inside protected routes

Testing & Validation

How this was tested

  1. Ran npm run dev and navigated to /onboarding
  2. Clicked through all steps to confirm navigation and form state work correctly
  3. Confirmed no "Config not initialized" error on page load
  4. Full end-to-end API call not testable locally (no Docker), but the fetch logic mirrors the existing pattern in startup.tsx

Screenshots/Recordings

Unfinished Work & Known Issues

  • None, this PR is complete and production-ready
  • The following items are intentionally deferred:



Notes & Nuances



Pre-Merge Checklist

Code Quality

  • [ x] Code follows the project's style guidelines and conventions
  • [ x] Self-review completed (I've reviewed my own code for obvious issues)
  • [ x] No debugging code, console logs, or commented-out code left behind
  • [ x] No merge conflicts with the base branch
  • [ x] Meaningful commit messages that explain the "why"

Testing & CI

  • [ x] All CI checks are passing
  • [ x] All new and existing tests pass locally
  • [ x] Test coverage hasn't decreased (or decrease is justified)
  • [ x] Linting passes without errors

Documentation

  • [x ] Code is self-documenting or includes helpful comments for complex logic
  • [x ] API documentation updated (if backend endpoints changed)
  • [ x] Type definitions are accurate and up-to-date

Reviewer Notes

  • Areas needing extra attention: ...
  • Questions for reviewers: ...

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 0% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 2.83%. Comparing base (3c87540) to head (d53f6c2).

Files with missing lines Patch % Lines
...s/web/src/components/onboarding/OnboardingPage.tsx 0.00% 34 Missing ⚠️
...s/web/src/components/onboarding/InviteTeamStep.tsx 0.00% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##            main    #467      +/-   ##
========================================
+ Coverage   2.42%   2.83%   +0.40%     
========================================
  Files        146     147       +1     
  Lines       8368    8445      +77     
  Branches      20      29       +9     
========================================
+ Hits         203     239      +36     
- Misses      8164    8205      +41     
  Partials       1       1              
Flag Coverage Δ
mobile 97.29% <ø> (?)
web 2.41% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/web/src/components/onboarding/InviteTeamStep.tsx 0.00% <0.00%> (ø)
...s/web/src/components/onboarding/OnboardingPage.tsx 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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