Skip to content

Commit

Permalink
update hostname on existingMacAddress dhcp event
Browse files Browse the repository at this point in the history
  • Loading branch information
LoV432 committed Nov 22, 2023
1 parent c2389fc commit 9c5210f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/dhcp-event/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export async function POST(request: Request) {
let userID = existingMacAddress.id;
let updateDevice = db
.prepare(
'UPDATE users SET ip = ?, last_updated = ?, last_event_type = ? WHERE id = ?'
'UPDATE users SET ip = ?, last_updated = ?, last_event_type = ?, name = ? WHERE id = ?'
)
.run(body.ip, Date.now(), body.type, userID);
.run(body.ip, Date.now(), body.type, body.hostname, userID);
return new Response(JSON.stringify(updateDevice), {
status: 200
});
Expand Down

0 comments on commit 9c5210f

Please sign in to comment.