Fix list page modal not refetching after save
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.
This commit is contained in:
parent
42b4b2812b
commit
7f0337a39c
2 changed files with 2 additions and 2 deletions
|
|
@ -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 */}
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ export default function DirectorExplorer({
|
|||
record={editingDirector as YsterbaardDirector}
|
||||
open={showEditDirector}
|
||||
onClose={() => { setShowEditDirector(false); setEditingDirector(null); }}
|
||||
onAfterSave={() => {}}
|
||||
onAfterSave={refreshAll}
|
||||
/>
|
||||
|
||||
{/* Result count */}
|
||||
|
|
|
|||
Loading…
Reference in a new issue