feat: Rewrite to use the Diyanet API

This commit is contained in:
2026-02-21 01:50:59 +03:00
parent 43d4560fbb
commit 73316d4e62
17 changed files with 637 additions and 9198 deletions
+6 -4
View File
@@ -1,7 +1,7 @@
const app = () => ({
futureTimes: [],
locationId: Alpine.$persist('11104'),
locationId: Alpine.$persist('11002'),
lastUpdated: Alpine.$persist(null),
userMinutes: 0,
now: new Date(),
@@ -47,9 +47,11 @@ const app = () => ({
const elapsedSeconds = (now - updatedAt) / 1000;
if (this.geolocation !== null) {
this.futureTimes = await fetchJSON(`/api/v1/diyanet/prayertimes?latitude=${this.geolocation.latitude}&longitude=${this.geolocation.longitude}`);
const response = await fetchJSON(`/api/v1/diyanet/prayertimes?latitude=${this.geolocation.latitude}&longitude=${this.geolocation.longitude}`);
this.futureTimes = response.prayertimes ?? [];
} else {
this.futureTimes = await fetchJSON(`/api/v1/diyanet/prayertimes?location_id=${this.locationId}`);
const response = await fetchJSON(`/api/v1/diyanet/prayertimes?location_id=${this.locationId}`);
this.futureTimes = response.prayertimes ?? [];
}
this.lastUpdated = now.toISOString();
},
@@ -205,4 +207,4 @@ function getUserLocation() {
(error) => reject(error.message)
);
});
}
}