2026-01-29 11:21:12 -06:00
|
|
|
import axios from "axios";
|
|
|
|
|
import { envConfig } from "./config";
|
|
|
|
|
|
|
|
|
|
export async function getTableByCount(idCuenta: number) {
|
|
|
|
|
try {
|
|
|
|
|
const res = await axios.get(
|
2026-02-06 10:39:20 -06:00
|
|
|
`${envConfig.apiUrl}/bitacora-mesa/table/${idCuenta}`,
|
2026-01-29 11:21:12 -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" };
|
|
|
|
|
}
|
|
|
|
|
}
|