We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29c145a commit 822b391Copy full SHA for 822b391
services/api/server.js
@@ -205,8 +205,10 @@ fastify.post(
205
const { ip, espID } = request.body;
206
const newSensor = { ip, espID };
207
208
+ console.log("Adding sensor:", newSensor);
209
+
210
// Check if same sensor already exists
- const existingSensor = await sensors.findOne({ ip });
211
+ const existingSensor = await sensors.findOne({ ip, espID });
212
if (existingSensor) {
213
reply.code(400).send({ error: "Sensor already exists." });
214
}
0 commit comments