From 8dab084547102476f9b87aa0ff3abecbfa6b17a4 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 3 Oct 2023 20:59:05 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EC=97=86=EB=8A=94=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20NotFound=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #666 --- src/pages/board/BoardView/BoardView.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/board/BoardView/BoardView.tsx b/src/pages/board/BoardView/BoardView.tsx index ff61f526..cbd5ac04 100644 --- a/src/pages/board/BoardView/BoardView.tsx +++ b/src/pages/board/BoardView/BoardView.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { useLocation, useParams } from 'react-router-dom'; import { useGetEachPostQuery } from '@api/postApi'; +import NotFound from '@pages/NotFound/NotFound'; import SecretPostModal from './Modal/SecretPostModal'; import AdjacentPostNavSection from './Section/AdjacentPostNavSection'; import BannerSection from './Section/BannerSection'; @@ -19,7 +20,7 @@ const BoardView = () => { const [secretPostModalOpen, setSecretPostModalOpen] = useState(false); const [password, setPassword] = useState(); - const { data: postInfo, isSuccess } = useGetEachPostQuery(postId, isSecret, password); + const { data: postInfo, isSuccess, isError } = useGetEachPostQuery(postId, isSecret, password); useEffect(() => { if (!isSuccess) return; @@ -33,6 +34,10 @@ const BoardView = () => { setSecretPostModalOpen(true); }, [isSecret]); + if (isError) { + return ; + } + return (
{postInfo && (