save data if sensor is on some floor
This commit is contained in:
parent
fae128bc1b
commit
e29c6db908
5 changed files with 25 additions and 15 deletions
|
@ -81,6 +81,9 @@ export const actions = {
|
|||
|
||||
try {
|
||||
const deviceData = JSON.parse(devices);
|
||||
deviceData.forEach(async (dev) => {
|
||||
await db.insert(table.sensors).values({ id: dev.id, user: event.locals.session.userId });
|
||||
});
|
||||
|
||||
// Check if floor exists
|
||||
const exists = await db
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue