Fixing the BFF Route Path Bug in v0.1.87
Fixing the BFF Route Path Bug in v0.1.87
Type: Critical Bug Fix
Version: 0.1.87
Affected component:src/app/api/bff/[...path]/route.ts
Background
myProp's backend-for-frontend (BFF) layer acts as a secure proxy between the client portal
UI and the AgentOS (letmc.com) REST API. All data fetching for landlord, tenant, buyer,
contractor, and messaging flows passes through this BFF.
A helper function — ppPath() — was responsible for constructing the URL suffix that gets
appended to the base AgentOS host before each API call.
The Problem
ppPath() was building paths using the following prefix for every call:
/v1/corporate/peopleportal/letmcletting/{clientName}
This is the correct prefix only for upload endpoints such as:
maintenance-requestuploadstenancy-applicationuploadsgeneric/upload
For all other AgentOS REST API calls, the correct base path is simply:
/{clientName}/...
Because every ppGet and ppPost call in the BFF used ppPath(), all non-upload API
calls were being sent to the wrong URLs. This affected data retrieval for:
| Portal type | Example calls affected |
|---|---|
| Landlord | Property details, financial statements, maintenance |
| Tenant | Tenancy info, rent statements, documents |
| Buyer | Offer status, property details |
| Contractor | Job instructions, maintenance requests |
| Messaging | Conversation threads |
The Fix
ppPath() was updated to return the correct path format:
// Before (incorrect)
return `/v1/corporate/peopleportal/letmcletting/${cn}${suffix}`;
// After (correct)
return `/${cn}${suffix}`;
Upload endpoints are handled entirely separately in src/lib/letmc/upload.ts, which
continues to construct the full /v1/corporate/peopleportal/letmcletting/ path correctly
and is unaffected by this change.
What This Means
- All BFF data fetching routes now call the correct AgentOS API endpoints.
- Portal data for landlords, tenants, buyers, contractors, and messaging will load as expected.
- File upload functionality is unchanged.
- No changes were made to authentication, session handling, or the public API surface.
Files Changed
| File | Change |
|---|---|
src/app/api/bff/[...path]/route.ts | Fixed ppPath() to omit the upload-specific URL prefix |
src/lib/letmc/upload.ts | No change — upload path construction was already correct |