diff --git a/app/api/edit/device-type/route.ts b/app/api/edit/device-type/route.ts index 6e35843..67d31e0 100644 --- a/app/api/edit/device-type/route.ts +++ b/app/api/edit/device-type/route.ts @@ -32,7 +32,7 @@ export async function POST(request: Request) { } let userID = existingMacAddress.id; let updateDevice = db - .prepare('UPDATE users SET deviceType = ? WHERE id = ?') + .prepare('UPDATE users SET device_type = ? WHERE id = ?') .run(body.deviceType, userID); return new Response(JSON.stringify(updateDevice), { status: 200 diff --git a/app/api/edit/display-name/route.ts b/app/api/edit/display-name/route.ts index b315f40..d58b0a4 100644 --- a/app/api/edit/display-name/route.ts +++ b/app/api/edit/display-name/route.ts @@ -1,18 +1,18 @@ import { db } from '@/lib/db'; import { userReturnType } from '../../dhcp-event/route'; -type display_nameType = { +type displayNameType = { macAddress: string; - display_name: string; + displayName: string; }; export async function POST(request: Request) { - const body = (await request.json()) as display_nameType; + const body = (await request.json()) as displayNameType; if ( !body.macAddress || body.macAddress === '' || - !body.display_name || - body.display_name === '' + !body.displayName || + body.displayName === '' ) { return new Response(JSON.stringify({ error: 'Missing required fields' }), { status: 400 @@ -33,7 +33,7 @@ export async function POST(request: Request) { let userID = existingMacAddress.id; let updateDisplayName = db .prepare('UPDATE users SET display_name = ? WHERE id = ?') - .run(body.display_name, userID); + .run(body.displayName, userID); return new Response(JSON.stringify(updateDisplayName), { status: 200 }); diff --git a/app/components/user-cards/UserCard.client.tsx b/app/components/user-cards/UserCard.client.tsx index 11262cd..55298e2 100644 --- a/app/components/user-cards/UserCard.client.tsx +++ b/app/components/user-cards/UserCard.client.tsx @@ -26,7 +26,7 @@ export default function UserCard({ user }: { user: userReturnType }) {