refactor(portal): partner-mode customer switcher on real tenants

Migrate the partner-mode customer switcher, in-customer banner, sidebar tile and the team invite/teammate panels off the data/customers fixture onto the real /api/partner/tenants list (shared key, gated to partner-staff so the global shell doesn't 403 for other users). Active customer resolves by tenant _id (the key the customers page already passes to partnerMode.enter); partner-identity labels now use the real partner name from useMe. Removes the now-unused customers + CustomerOrg-list fixture export and the dead setCustomer helper. Verified in UI: switcher + enter/exit show real Baslund Test / Baslund Research ApS.
This commit is contained in:
Ronni Baslund
2026-05-30 14:51:14 +02:00
parent 60e0b2286c
commit 7720e4be83
7 changed files with 67 additions and 63 deletions
+2 -6
View File
@@ -4,9 +4,8 @@
//
// In real use, every action while in this mode is logged with the partner's
// identity (not the customer's) — the design spec is explicit about this for
// trust. For the prototype we just hold the customer id.
import type { CustomerOrg } from '~/types/partner'
// trust. We hold the active customer's tenant _id (the same key the customers
// page passes to enter()); consumers resolve it against the real tenant list.
const activeCustomerId = ref<string | null>(null)
@@ -34,8 +33,5 @@ export const usePartnerMode = () => {
enter,
exit,
hydrate,
setCustomer: (c: CustomerOrg | null) => {
activeCustomerId.value = c?.id ?? null
},
}
}