diff --git a/src/api/_http.ts b/src/api/_http.ts index 450bb1b..1da2307 100644 --- a/src/api/_http.ts +++ b/src/api/_http.ts @@ -5,8 +5,8 @@ export interface LawLowResponse { success: boolean; data?: T; statusCode?: number; - message?: string[]; - detail?: string[]; + errorMessage?: string[]; + errorDetail?: string[]; } class Http { diff --git a/src/components/ErrorFallback.tsx b/src/components/ErrorFallback.tsx index 0ad299c..cd7d0b2 100644 --- a/src/components/ErrorFallback.tsx +++ b/src/components/ErrorFallback.tsx @@ -7,8 +7,10 @@ import styled from "styled-components"; import { ErrorFallbackProps } from "@/interface/error"; const ContentWrapper = styled.main` - width: 100vw; - height: 100vh; + background: #fff; + width: 390px; + height: 844px; + border-radius: 40px; display: flex; flex-direction: column; justify-content: center; @@ -23,7 +25,7 @@ const ContentWrapper = styled.main` .MuiButton-root { height: 40px; - width: 60vw; + width: 60%; border-radius: 15.867px; background: var(--orange, #ffbc10); color: var(--black-2, #3a3a3a); @@ -38,13 +40,14 @@ const ContentWrapper = styled.main` const ERROR_MAP: { [key: string]: string } = { "q should not be empty": "검색어는 비어 있으면 안돼요.😢", + "ThrottlerException: Too Many Requests": "너무 많은 요청이 들어왔어요.😢", }; const ErrorFallback = ({ error, resetErrorBoundary }: ErrorFallbackProps) => { const [msg] = useState(() => { if (error.name === "AxiosError") { // eslint-disable-next-line no-unsafe-optional-chaining - const m = error.response?.data.message ?? ([] as string[]); + const m = error.response?.data.errorMessage ?? ([] as string[]); const mArr = m .map((x) => { if (x in ERROR_MAP) return ERROR_MAP[x as keyof typeof ERROR_MAP]; diff --git a/src/interface/error.ts b/src/interface/error.ts index a9d234b..c2f62c4 100644 --- a/src/interface/error.ts +++ b/src/interface/error.ts @@ -6,7 +6,7 @@ import { LawLowResponse } from "@/api/_http"; export interface CommonErrorProps { statusCode: Pick["statusCode"]; - message: Pick["message"]; + errorMessage: Pick["errorMessage"]; onReset?: () => void; } diff --git a/src/pages/SearchDetail/components/AiTabPanel.tsx b/src/pages/SearchDetail/components/AiTabPanel.tsx index 8a4da96..ee25087 100644 --- a/src/pages/SearchDetail/components/AiTabPanel.tsx +++ b/src/pages/SearchDetail/components/AiTabPanel.tsx @@ -151,11 +151,11 @@ const Content = ({ useEffect(() => { if (data) { - setText(data.summary); + setText(data.summary.replaceAll("/n", "
")); } }, [data]); - return {text}; + return ; }; const AiTabPanel = ({