fix bug
All checks were successful
Build and Release / release (push) Successful in 27s

This commit is contained in:
2026-04-20 08:12:29 +07:00
parent 4018d8e135
commit fc3d900871
3 changed files with 8 additions and 9 deletions

View File

@@ -9,14 +9,17 @@ import { MediaDto } from "@/interface/media";
import { UserMetaCardProps } from "@/interface/user";
import { apiGetCurrentUser } from "@/service/auth";
import { apiGetCurrentUserApplications, apiGetCurrentUserMedia } from "@/service/userService";
import { setUserData } from "@/store/features/userSlice";
import { useEffect, useState } from "react";
import { useDispatch } from "react-redux";
export default function Profile() {
const [user, setUser] = useState<UserMetaCardProps | null>(null);
const [mediaData, setMediaData] = useState<MediaDto | null>(null);
const [applications, setApplications] = useState<any[]>([]);
const [loading, setLoading] = useState(true);
const dispatch = useDispatch();
useEffect(() => {
const fetchUser = async () => {
try {
@@ -24,11 +27,12 @@ export default function Profile() {
const mediaResponse = await apiGetCurrentUserMedia();
const userApplications = await apiGetCurrentUserApplications();
console.log(userData);
console.log("user", userData);
if (userApplications?.data) {
setApplications(userApplications.data);
}
dispatch(setUserData(userData.data));
setMediaData(mediaResponse);
setUser(userData);

View File

@@ -7,7 +7,7 @@ export default function GetUser() {
const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
const fetchUser = async () => {
try {