Profile page fetches full data from API via GetByUserId
All checks were successful
Build frontend / build (push) Successful in 39s

- Added getCustomerByUserId and getOwnerByUserId API functions
- Profile page extracts user ID (SID) from JWT, calls appropriate endpoint
- Falls back to JWT/localStorage if API call fails
- Maps API fields (firstName, lastName, whatsAppNumber, phone, etc.) to form
This commit is contained in:
Claw AI
2026-03-28 17:03:40 +00:00
parent 48523067fc
commit b6e9f01938
2 changed files with 68 additions and 22 deletions

View File

@ -157,6 +157,18 @@ export async function getTerms() {
return apiFetch('/Terms/GetTerms');
}
// ─── Profile ───
export async function getCustomerByUserId(userId) {
console.log('[API] Fetching customer by user ID:', userId);
return apiFetch(`/Customer/GetByUserId/${userId}`);
}
export async function getOwnerByUserId(userId) {
console.log('[API] Fetching owner by user ID:', userId);
return apiFetch(`/Owner/GetByUserId/${userId}`);
}
// ─── Auth: Registration ───
/**