fix(directory) : refresh clients list after converting a prospect
Pull Request — Quality gate / Frontend (build) (pull_request) Successful in 1m13s
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 1m32s

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.
This commit is contained in:
Matthieu
2026-06-23 12:14:44 +02:00
parent bf55a55fa6
commit bfbab5bbf2
@@ -103,7 +103,7 @@
<ProspectDrawer <ProspectDrawer
v-model="prospectDrawerOpen" v-model="prospectDrawerOpen"
:prospect="selectedProspect" :prospect="selectedProspect"
@saved="loadProspects" @saved="onProspectSaved"
/> />
</div> </div>
</template> </template>
@@ -215,7 +215,14 @@ function openEditProspect(item: Record<string, unknown>) {
async function convertProspect(row: ProspectRow) { async function convertProspect(row: ProspectRow) {
await prospectService.convert(row.id) 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) watch(statusFilter, loadProspects)