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

@@ -37,6 +37,7 @@ import { API_BASE } from "@/config/api.config";
export const Header = () => {
const navigate = useNavigate();
const userData = useUserContext();
console.log(userData);
const { t } = useTranslation();
// Error handling states
@@ -91,9 +92,7 @@ export const Header = () => {
setConfirmPassword("");
};
const username = userData?.username
? userData.username[0].toUpperCase() + userData.username.slice(1)
: "User";
const username = userData.first_name ? userData.first_name : "N/A";
const logout = () => {
Cookies.remove("token");