Enhance user management: update User context and API to include first name, last name, and admin status
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user