add API code for /api/packets

This commit is contained in:
Pablo Revilla
2025-08-06 17:18:48 -07:00
parent a9514a0238
commit 706c71ef39

View File

@@ -1100,9 +1100,9 @@ async def api_packets(request):
async def net(request):
try:
# Fetch packets for the given node ID and port number
after_time = datetime.datetime.now() - timedelta(days=6)
packets = await store.get_packets(
node_id=0xFFFFFFFF, portnum=PortNum.TEXT_MESSAGE_APP, since=timedelta(days=3)
)
node_id=0xFFFFFFFF, portnum=PortNum.TEXT_MESSAGE_APP, after=after_time)
# Convert packets to UI packets
ui_packets = [Packet.from_model(p) for p in packets]