Skip to content

Commit

Permalink
Feat: 최종 배포, 심화 구현 어드민 알림 및 좋아요 표시 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyobar committed Sep 10, 2024
1 parent 0d5abc7 commit e915342
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/common/header/HeaderInfoLogged.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useLocation, useNavigate } from "react-router-dom";
import ProfileImage from "../profile/ProfileImage";
import { useUserStore } from "../../config/store";
import { useArticleStore, useUserStore } from "../../config/store";
import Button from "../button/Button";
import { accountApi, authApi, notificationApi } from "../../api";
import { accountApi, articleApi, authApi, notificationApi } from "../../api";
import { useCallback, useEffect, useState } from "react";
import { CgProfile } from "react-icons/cg";
import { ModalPortal } from "../../config/ModalPortal";
Expand Down Expand Up @@ -54,6 +54,7 @@ const HeaderInfoLogged = () => {
const [isAdmin, setIsAdmin] = useState(false);
const location = useLocation();
const queryClient = useQueryClient();
const { initArticle } = useArticleStore();

const openDetailModal = (article_id: number, notification_id: number) => {
setSelectedArticleId(article_id);
Expand Down Expand Up @@ -82,7 +83,9 @@ const HeaderInfoLogged = () => {

const handleLogout = async () => {
await authApi.userLogout();
window.location.reload();
const articleResponse = await articleApi.articleList();
initArticle(articleResponse.data);
nav("/");
};

const userLevelCalculate = useCallback(async () => {
Expand Down

0 comments on commit e915342

Please sign in to comment.