From bfbab5bbf24b63d4dbb254b399797d0391adbaf5 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Tue, 23 Jun 2026 12:14:44 +0200 Subject: [PATCH] fix(directory) : refresh clients list after converting a prospect Converting a prospect creates a client and removes the prospect, but only loadProspects() was called, so the new client did not appear in the Clients tab until a manual page refresh. Both the table convert button and the ProspectDrawer saved event now reload prospects and clients. --- frontend/modules/directory/pages/directory/index.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/modules/directory/pages/directory/index.vue b/frontend/modules/directory/pages/directory/index.vue index 4c0e8db..3803d64 100644 --- a/frontend/modules/directory/pages/directory/index.vue +++ b/frontend/modules/directory/pages/directory/index.vue @@ -103,7 +103,7 @@ @@ -215,7 +215,14 @@ function openEditProspect(item: Record) { async function convertProspect(row: ProspectRow) { await prospectService.convert(row.id) - await loadProspects() + // La conversion crée un client et retire le prospect : rafraîchir les deux listes. + await Promise.all([loadProspects(), loadClients()]) +} + +// Le ProspectDrawer porte aussi le bouton « Convertir » : son event 'saved' peut +// donc être une conversion → toujours rafraîchir les deux listes par sécurité. +async function onProspectSaved() { + await Promise.all([loadProspects(), loadClients()]) } watch(statusFilter, loadProspects)