From 247218946171f548773531cc40050c66409b0a40 Mon Sep 17 00:00:00 2001 From: ej070961 Date: Sat, 10 Aug 2024 17:30:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=94=84=EB=A6=AC=EC=82=AC=EC=9D=B8?= =?UTF-8?q?=EB=93=9C=20axiosInstance=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/file-upload.ts | 8 +++----- src/components/SponsorDetail/ContentDetail.tsx | 4 ++-- src/components/SponsorDetail/DonateModal.tsx | 6 +++--- src/components/SponsorDetail/Header.tsx | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/apis/file-upload.ts b/src/apis/file-upload.ts index c8d03b5..bd44504 100644 --- a/src/apis/file-upload.ts +++ b/src/apis/file-upload.ts @@ -1,5 +1,6 @@ import axios from "axios"; import { CommonError } from "../@types/api"; +import { axiosInstance } from "."; export const getPresignedUrl = async ( prefix: string, @@ -7,15 +8,12 @@ export const getPresignedUrl = async ( accesstoken: string ) => { try { - const res = await axios.get( - `/api/v1/files/presigned-url?prefix=images/${prefix}&fileName=${fileName}`, + const res = await axiosInstance.get( + `/files/presigned-url?prefix=images/${prefix}&fileName=${fileName}`, { headers: { Authorization: `Bearer ${accesstoken}`, - // 다른 헤더를 추가할 수 있습니다. - "Content-Type": "application/json", }, - withCredentials: true, } ); return res.data; diff --git a/src/components/SponsorDetail/ContentDetail.tsx b/src/components/SponsorDetail/ContentDetail.tsx index 828b5ff..1211ee9 100644 --- a/src/components/SponsorDetail/ContentDetail.tsx +++ b/src/components/SponsorDetail/ContentDetail.tsx @@ -12,7 +12,7 @@ function ContentDetail({ data }: ContentDetailProps) { D-{data.leftDays} - + {data.expirationDate} @@ -64,7 +64,7 @@ const Container = styled.div` ${tw`font-bold text-bold-64 text-subColor`} } .medium-20 { - ${tw`font-medium text-fontColor3 text-medium-20 w-[79px]`} + ${tw`font-medium text-fontColor3 text-medium-20 `} } .title { ${tw`font-bold text-bold-48 text-fontColor1`} diff --git a/src/components/SponsorDetail/DonateModal.tsx b/src/components/SponsorDetail/DonateModal.tsx index 09d96f0..6c1db03 100644 --- a/src/components/SponsorDetail/DonateModal.tsx +++ b/src/components/SponsorDetail/DonateModal.tsx @@ -67,7 +67,7 @@ function DonateModal({ onClose }: { onClose: () => void }) { account ); - if (res.success) { + if (res.status === 200) { setIsFinished(true); } }; @@ -75,7 +75,7 @@ function DonateModal({ onClose }: { onClose: () => void }) { return ( {!isFinished ? ( - + e.stopPropagation()}> D-{data.leftDays} {data.title} @@ -117,7 +117,7 @@ function DonateModal({ onClose }: { onClose: () => void }) { ) : ( - + e.stopPropagation()}> 후원이 완료되었습니다. {nickname} 후원자님의 보탬이 {data.nickname} 님에게 큰 도움이 diff --git a/src/components/SponsorDetail/Header.tsx b/src/components/SponsorDetail/Header.tsx index 1632b4a..f6abc16 100644 --- a/src/components/SponsorDetail/Header.tsx +++ b/src/components/SponsorDetail/Header.tsx @@ -26,7 +26,7 @@ function Header({ memberId, nickname }: HeaderProps) { const navigate = useNavigate(); const { supportId } = useParams<{ supportId: string }>(); const accessToken = useAuthStore((state) => state.accessToken!); - + console.log(isOpenDonate); // 수정하기 클릭시 함수 호출 const handleUpdate = async () => { const res = await getUpdate(supportId!, accessToken);