Files

24 lines
620 B
TypeScript
Raw Permalink Normal View History

2026-01-27 16:11:17 -06:00
import axios from "axios";
import { envConfig } from "./config";
import Cookies from "js-cookie";
2026-01-27 16:11:17 -06:00
export async function getEquipoByCount(idCuenta: number) {
try {
const token = Cookies.get("token");
const headers = { Authorization: `Bearer ${token}` };
2026-01-27 16:11:17 -06:00
const res = await axios.get(
`${envConfig.apiUrl}/bitacora/cuenta/${idCuenta}`,
{ headers },
2026-01-27 16:11:17 -06:00
);
return res.data;
} catch (error: any) {
if (axios.isAxiosError(error)) {
return {
error: error.response?.data?.message || "Error al consultar equipo",
};
}
return { error: "Error desconocido" };
}
}