Gestion de apis
This commit is contained in:
parent
5202b768c5
commit
ce16ed90c3
|
|
@ -39,7 +39,7 @@ async function loadStats() {
|
||||||
|
|
||||||
async function loadStatsToday() {
|
async function loadStatsToday() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(API_URL_TODAY);
|
const response = await fetch(API_URL);
|
||||||
if (!response.ok) throw new Error("Error cargando datos: " + response.status);
|
if (!response.ok) throw new Error("Error cargando datos: " + response.status);
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
@ -67,7 +67,7 @@ function renderLastData(data) {
|
||||||
$("last-wind").textContent = last.viento_velocidad + " km/h";
|
$("last-wind").textContent = last.viento_velocidad + " km/h";
|
||||||
$("last-sunrise").textContent = last.amanecer;
|
$("last-sunrise").textContent = last.amanecer;
|
||||||
$("last-sunset").textContent = last.anochecer;
|
$("last-sunset").textContent = last.anochecer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====================
|
// ====================
|
||||||
// Estadísticas del mes seleccionado
|
// Estadísticas del mes seleccionado
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue