Files
front-AT/app/lib/login.ts
T

19 lines
451 B
TypeScript
Raw Normal View History

2025-09-10 21:00:00 -04:00
import axios from "axios";
import { envConfig } from "./config";
export async function loginUser(usuario: string, password: string) {
2025-09-19 17:20:05 -06:00
try {
const response = await axios.post(`${envConfig.apiUrl}/user`, {
usuario,
password,
});
return response.data;
} catch (error: any) {
const msg =
error.response?.data?.message ||
error.message ||
"Error desconocido en el login";
return { error: msg };
}
2025-09-10 21:00:00 -04:00
}