From 9c5210f5ebf82f9f4a84902f308365f900f34703 Mon Sep 17 00:00:00 2001 From: LoV432 Date: Wed, 22 Nov 2023 16:12:24 +0500 Subject: [PATCH] update hostname on existingMacAddress dhcp event --- app/api/dhcp-event/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/dhcp-event/route.ts b/app/api/dhcp-event/route.ts index 2bc8726..9dc4143 100644 --- a/app/api/dhcp-event/route.ts +++ b/app/api/dhcp-event/route.ts @@ -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 });