Enhance user management: update User context and API to include first name, last name, and admin status

This commit is contained in:
2025-11-21 17:10:48 +01:00
parent 1076b12668
commit ca8030afbd
4 changed files with 17 additions and 6 deletions

View File

@@ -3,6 +3,9 @@ import { useContext } from "react";
export interface User {
username: string;
is_admin: boolean;
first_name: string;
last_name: string;
role: number;
}
@@ -12,8 +15,8 @@ export function useUserContext() {
const user = useContext(UserContext);
if (user === undefined) {
throw new Error("useUserContext must be used with a UserContext")
throw new Error("useUserContext must be used with a UserContext");
}
return user;
}
}