sockets work
This commit is contained in:
@ -24,8 +24,8 @@ router.get("/", async (req, res, next) => {
|
||||
router.post("/new", async (req, res, next) => {
|
||||
try {
|
||||
const { id_sensor, id_location, sensordata } = req.body;
|
||||
await addSensorData(id_sensor, id_location, sensordata);
|
||||
res.sendStatus(200).json({ message: "SensorData " + id + " added" });
|
||||
let data = await addSensorData(id_sensor, id_location, sensordata);
|
||||
res.json({ message: "SensorData " + data.id + " added", ...data });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
next(error);
|
||||
|
Reference in New Issue
Block a user