Push geo-filter: Giftköder-Alert nur im 30km-Radius, Standort via Alerts-Check gespeichert
This commit is contained in:
parent
9213b58d3c
commit
b5e4eab84d
4 changed files with 44 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ from pydantic import BaseModel
|
|||
from typing import Optional
|
||||
from database import db
|
||||
from auth import get_current_user
|
||||
from routes.push import send_push_to_all
|
||||
from routes.push import send_push_nearby
|
||||
from media_utils import convert_media
|
||||
from ratelimit import check as rl_check
|
||||
|
||||
|
|
@ -91,8 +91,8 @@ async def report_poison(data: PoisonCreate, request: Request,
|
|||
).fetchone()
|
||||
entry = dict(row)
|
||||
|
||||
# Push-Notification an alle User
|
||||
send_push_to_all({
|
||||
# Push nur an User im Umkreis von 30 km
|
||||
send_push_nearby(data.lat, data.lon, 30_000, {
|
||||
"type": "poison_alert",
|
||||
"title": "⚠️ Giftköder gemeldet!",
|
||||
"body": f"{data.typ or 'Verdächtiger Fund'} in deiner Nähe — bitte vorsichtig sein.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue