Client Portal - Fix Employee Data

This commit is contained in:
Muhammad Fajar
2024-01-06 12:17:39 +07:00
parent 562f3121c5
commit b865802806
2 changed files with 102 additions and 86 deletions

View File

@@ -25,6 +25,7 @@ export default function UserProfile() {
const { themeStretch } = useSettings();
const navigate = useNavigate();
const [data, setData] = useState<UserProfileDataType>();
const [loading, setLoading] = useState(true);
const { corporateValue } = useContext(UserCurrentCorporateContext);
const { id } = useParams();
@@ -35,8 +36,8 @@ export default function UserProfile() {
.get(corporateValue + '/members/' + id)
.then((response) => {
setTimeout(() => {
console.log(response.data);
setData(response.data);
setLoading(false);
}, 1000);
})
.catch((error) => {
@@ -64,7 +65,7 @@ export default function UserProfile() {
<CardPersonalInformation data={data?.person} />
</Grid>
<Grid item xs={12} md={12}>
<CardFamilyInformation data={data?.families} />
<CardFamilyInformation data={data?.families} loading={loading} />
</Grid>
</Grid>
</Container>