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.
This commit is contained in:
@@ -103,7 +103,7 @@
|
||||
<ProspectDrawer
|
||||
v-model="prospectDrawerOpen"
|
||||
:prospect="selectedProspect"
|
||||
@saved="loadProspects"
|
||||
@saved="onProspectSaved"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -215,7 +215,14 @@ function openEditProspect(item: Record<string, unknown>) {
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user