feat: reworked ttn webhook endpoint logic
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user