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 }) {
@@ -85,10 +85,10 @@ function UserSpeed({ ip }: { ip: string }) { function DropDown({ mac_address, - deviceType + device_type }: { mac_address: string; - deviceType: string; + device_type: string; }) { const [dropDownIsOpen, SetDropDownIsOpen] = useState(false); const [macAddress] = useState(mac_address); @@ -115,7 +115,7 @@ function DropDown({ className="btn m-0 h-fit w-full border-none bg-transparent p-0 hover:bg-transparent active:bg-transparent" >