Skip to content

hotel id header injection - MERGE AFTER ONBOARDING/CLERK ORGS#287

Merged
manueltorres0 merged 6 commits intomainfrom
chore/hotel-id-api-reqs-FE
Apr 7, 2026
Merged

hotel id header injection - MERGE AFTER ONBOARDING/CLERK ORGS#287
manueltorres0 merged 6 commits intomainfrom
chore/hotel-id-api-reqs-FE

Conversation

@manueltorres0
Copy link
Copy Markdown
Contributor

Description

  • inject the hotel id to frontend api requests using the clerk org context
  • added the hotel id to frontend config

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 #241

What Changed?

  • hotel id needed in API reqs header is no longer hardcoded

Testing & Validation

How this was tested

  1. no testing yet, onboarding + clerk orgs need to be merged

Notes & Nuances

  • *** MUST NOT BE MERGED BEFORE ONBOARDING AND CLERK ORGS, DEPENDS ON THOSE PRS

Pre-Merge Checklist

Code Quality

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

Testing & CI

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

Documentation

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

Reviewer Notes

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

@manueltorres0 manueltorres0 changed the title hotel id header injection hotel id header injection - DO NOT MERGE BEFORE ONBOARDING/CLERK ORGS Apr 5, 2026
@manueltorres0 manueltorres0 changed the title hotel id header injection - DO NOT MERGE BEFORE ONBOARDING/CLERK ORGS hotel id header injection - MERGE AFTER ONBOARDING/CLERK ORGS Apr 5, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 1.88%. Comparing base (87ced32) to head (a076596).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
clients/web/src/routes/__root.tsx 0.00% 13 Missing ⚠️
clients/web/src/routeTree.gen.ts 0.00% 7 Missing ⚠️
clients/web/src/routes/no-org.tsx 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##            main    #287      +/-   ##
========================================
+ Coverage   0.62%   1.88%   +1.26%     
========================================
  Files         78      86       +8     
  Lines       3218    3289      +71     
  Branches       0      24      +24     
========================================
+ Hits          20      62      +42     
- Misses      3198    3227      +29     
Flag Coverage Δ
mobile 84.00% <ø> (?)
web 0.61% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
clients/web/src/routes/no-org.tsx 0.00% <0.00%> (ø)
clients/web/src/routeTree.gen.ts 0.00% <0.00%> (ø)
clients/web/src/routes/__root.tsx 0.00% <0.00%> (ø)

... and 7 files 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.

Copy link
Copy Markdown
Contributor

@Dao-Ho Dao-Ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, this ship is much needed 🔥

function AppConfigurator() {
const { getToken } = useAuth();
const { organization } = useOrganization();
const hotelId = organization?.publicMetadata.hotel_id as string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same cmt as above

function AppConfigurator() {
const { getToken } = useAuth();
const { organization } = useOrganization();
const hotelId = organization?.publicMetadata?.hotel_id as string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels like this shouldn't need a typecast. Assuming that casting is used here for empty case (user isn't part of an org), I'd actually redirect them to a separate page letting them know instead of casting into an empty string as it'll cause some downstream errors that aren't accurate to what the problem is

Copy link
Copy Markdown
Contributor

@Dao-Ho Dao-Ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥

@manueltorres0 manueltorres0 merged commit 11c9822 into main Apr 7, 2026
12 checks passed
@manueltorres0 manueltorres0 deleted the chore/hotel-id-api-reqs-FE branch April 7, 2026 18:52
Dao-Ho added a commit that referenced this pull request Apr 7, 2026
Dao-Ho added a commit that referenced this pull request Apr 7, 2026
manueltorres0 added a commit that referenced this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(urethon): Clerk Syncing Orgs

3 participants