feat(F-083): completed feature
This commit is contained in:
@@ -195,7 +195,26 @@ export default function CustomersPage() {
|
||||
{c.createdAt ? new Date(c.createdAt).toLocaleDateString('es-ES') : '—'}
|
||||
</td>
|
||||
<td className="px-4 py-3.5">
|
||||
<RowActions onEdit={() => router.push(`/customers/${c.id}`)} />
|
||||
<div className="flex items-center gap-1">
|
||||
<button
|
||||
onClick={async () => {
|
||||
setMsg(`Enviando enlace de recuperación a ${c.email}...`);
|
||||
try {
|
||||
await customersApi.sendPasswordResetLink(c.email);
|
||||
setMsg(`✓ Enlace enviado a ${c.email}`);
|
||||
} catch {
|
||||
setMsg(`✗ No se pudo enviar el enlace a ${c.email}`);
|
||||
} finally {
|
||||
setTimeout(() => setMsg(''), 4000);
|
||||
}
|
||||
}}
|
||||
title="Enviar enlace de recuperación de contraseña"
|
||||
className="px-2 py-1 text-xs text-[#2D6A4F] hover:bg-green-50 rounded-lg transition-colors"
|
||||
>
|
||||
🔑
|
||||
</button>
|
||||
<RowActions onEdit={() => router.push(`/customers/${c.id}`)} />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
@@ -120,6 +120,8 @@ export const customersApi = {
|
||||
api.patch<import('@/types').Customer>(`/api/users/${id}`, data),
|
||||
create: (data: { email: string; password: string; displayName?: string; phone?: string }) =>
|
||||
api.post<import('@/types').Customer>('/api/auth/register', data),
|
||||
sendPasswordResetLink: (email: string) =>
|
||||
api.post<{ ok: boolean }>('/api/auth/password-reset/request', { email }),
|
||||
// ── Direcciones (FIX-18) ───────────────────────────────────────────────────
|
||||
listAddresses: (id: string) =>
|
||||
api.get<{ items: import('@/types').Address[] }>(`/api/users/${id}/addresses`),
|
||||
|
||||
Reference in New Issue
Block a user