v0.2.1! Adds instant Hazard List updates after hazard sync
Some checks are pending
build-docker / Build Image (push) Waiting to run
Some checks are pending
build-docker / Build Image (push) Waiting to run
This commit is contained in:
parent
0f2d64b908
commit
dbb32fd2f9
9 changed files with 362 additions and 5 deletions
|
|
@ -290,13 +290,19 @@ class Hazards extends WeatherDisplay {
|
|||
}));
|
||||
|
||||
// Send to backend
|
||||
await fetch(withBasePath('api/hazard-history'), {
|
||||
const response = await fetch(withBasePath('api/hazard-history'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ location, locationKey, hazards }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Hazard history sync failed with status ${response.status}`);
|
||||
}
|
||||
|
||||
window.dispatchEvent(new CustomEvent('hazard-history-updated'));
|
||||
} catch (error) {
|
||||
// Silently fail - hazard history is non-critical
|
||||
if (debugFlag('verbose-failures')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue