clear inertia cache on organization change to fix wrongly loaded stale pages

This commit is contained in:
Gregor Vostrak
2026-02-16 16:44:20 +01:00
parent 8107c6a208
commit ed2b7476ae
+4
View File
@@ -12,6 +12,10 @@ import { getCurrentOrganizationId } from '@/utils/useUser';
import { api } from '@/packages/api/src';
export function switchOrganization(organizationId: string) {
// Clear Inertia's prefetch cache to prevent stale pages from the old
// organization being served when navigating after the switch.
router.flushAll();
router.put(
route('current-team.update'),
{