mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-05-07 20:32:26 +00:00
clear inertia cache on organization change to fix wrongly loaded stale pages
This commit is contained in:
@@ -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'),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user