feat(prospecting): add delete button to prospects list

- Trash icon button in Actions column with confirmation dialog
- Calls DELETE /admin/prospecting/prospects/{id} (existing endpoint)
- Reloads list after successful deletion
- Toast notification on success/failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 22:59:12 +02:00
parent b51f9e8e30
commit 377d2d3ae8
2 changed files with 17 additions and 0 deletions

View File

@@ -152,6 +152,18 @@ function prospectsList() {
if (this.pagination.page > 1) { this.pagination.page--; this.loadProspects(); }
},
async deleteProspect(prospect) {
var name = prospect.business_name || prospect.domain_name || 'this prospect';
if (!confirm('Delete "' + name + '"? This cannot be undone.')) return;
try {
await apiClient.delete('/admin/prospecting/prospects/' + prospect.id);
Utils.showToast('Prospect deleted', 'success');
await this.loadProspects();
} catch (err) {
Utils.showToast('Failed: ' + err.message, 'error');
}
},
statusBadgeClass(status) {
const classes = {
pending: 'text-yellow-700 bg-yellow-100 dark:text-yellow-100 dark:bg-yellow-700',

View File

@@ -132,6 +132,11 @@
title="View details">
<span x-html="$icon('eye', 'w-5 h-5')"></span>
</a>
<button type="button" @click="deleteProspect(p)"
class="flex items-center justify-center p-2 text-red-600 rounded-lg hover:bg-red-50 dark:text-red-400 dark:hover:bg-gray-700 focus:outline-none transition-colors"
title="Delete">
<span x-html="$icon('trash', 'w-5 h-5')"></span>
</button>
</div>
</td>
</tr>