Skip to content

Commit 822b391

Browse files
committed
Log sensor
1 parent 29c145a commit 822b391

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/api/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,10 @@ fastify.post(
205205
const { ip, espID } = request.body;
206206
const newSensor = { ip, espID };
207207

208+
console.log("Adding sensor:", newSensor);
209+
208210
// Check if same sensor already exists
209-
const existingSensor = await sensors.findOne({ ip });
211+
const existingSensor = await sensors.findOne({ ip, espID });
210212
if (existingSensor) {
211213
reply.code(400).send({ error: "Sensor already exists." });
212214
}

0 commit comments

Comments
 (0)