Private
Public Access
11 lines
339 B
TypeScript
11 lines
339 B
TypeScript
import { API_URL } from '../env';
|
|
import { getToken } from './token';
|
|
|
|
export async function borrarUsuario(id: number): Promise<void> {
|
|
const response = await fetch(`${API_URL}/users/${id}`, {
|
|
method: 'DELETE',
|
|
headers: { Authorization: `Bearer ${getToken()}` }
|
|
});
|
|
if (!response.ok) throw new Error('Error al eliminar usuario');
|
|
}
|