From 7f0337a39cbc8f33ea3816a083bae64255c66913 Mon Sep 17 00:00:00 2001 From: Ysterbaard Date: Wed, 19 Aug 2026 11:42:02 +0200 Subject: [PATCH] Fix list page modal not refetching after save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the edit modal was opened from /companies or /directors (the list pages) and the user saved, the modal called onAfterSave={() => {}} — an empty handler. The modal also fired qc.invalidateQueries(['pb-list', collection]), but the list page's queryKey is ['companies', ...] (or ['directors', ...]), not ['pb-list', ...]. So the list page never re-fetched. Result: stale row data persisted in the list state. Re-opening the modal showed the original values, making it look like the save hadn't taken effect (it had — the data was in PB; the list just didn't know about it). Fix: wire onAfterSave to the existing refreshAll() helper in both list pages so the list refetches from PB and the local editingCompany/editingDirector state stays in sync. --- app/companies/CompanyExplorer.tsx | 2 +- app/directors/DirectorExplorer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/companies/CompanyExplorer.tsx b/app/companies/CompanyExplorer.tsx index 5ec84fa..7886909 100644 --- a/app/companies/CompanyExplorer.tsx +++ b/app/companies/CompanyExplorer.tsx @@ -279,7 +279,7 @@ export default function CompanyExplorer({ record={editingCompany as YsterbaardCompany} open={showEditCompany} onClose={() => { setShowEditCompany(false); setEditingCompany(null); }} - onAfterSave={() => {}} + onAfterSave={refreshAll} /> {/* Client filter pills */} diff --git a/app/directors/DirectorExplorer.tsx b/app/directors/DirectorExplorer.tsx index 1971a38..db2e9c8 100644 --- a/app/directors/DirectorExplorer.tsx +++ b/app/directors/DirectorExplorer.tsx @@ -214,7 +214,7 @@ export default function DirectorExplorer({ record={editingDirector as YsterbaardDirector} open={showEditDirector} onClose={() => { setShowEditDirector(false); setEditingDirector(null); }} - onAfterSave={() => {}} + onAfterSave={refreshAll} /> {/* Result count */}