feat: reworked ttn webhook endpoint logic

This commit is contained in:
2025-01-03 02:01:55 +01:00
parent ffdb644700
commit 62847f569d
17 changed files with 273 additions and 356 deletions

View File

@ -40,7 +40,10 @@ router.post("/", async (req: Request, res: Response) => {
router.put("/:id", async (req: Request, res: Response) => {
try {
const { id } = req.params;
const updatedWifiScan = await wifiScanService.updateWifiScan(id, req.body);
const updatedWifiScan = await wifiScanService.updateWifiScan({
...req.body,
wifi_scan_id: id,
});
if (!updatedWifiScan) {
res.status(404).json({ error: "Wifi scan not found" });
return;