Skip to content

Commit

Permalink
Merge pull request #64 from ej070961/develop
Browse files Browse the repository at this point in the history
fix: 프리사인드 axiosInstance 설정
  • Loading branch information
ej070961 authored Aug 10, 2024
2 parents 2446e57 + 2472189 commit 63ed0d4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions src/apis/file-upload.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import axios from "axios";
import { CommonError } from "../@types/api";
import { axiosInstance } from ".";

export const getPresignedUrl = async (
prefix: string,
fileName: string,
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;
Expand Down
4 changes: 2 additions & 2 deletions src/components/SponsorDetail/ContentDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ContentDetail({ data }: ContentDetailProps) {
<Container>
<RowBox className="justify-between items-center">
<span className="d-day">D-{data.leftDays}</span>
<ColBox className="justify-end">
<ColBox className="justify-end ">
<label className="medium-20">후원기간</label>
<span className="medium-20">{data.expirationDate}</span>
</ColBox>
Expand Down Expand Up @@ -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`}
Expand Down
6 changes: 3 additions & 3 deletions src/components/SponsorDetail/DonateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ function DonateModal({ onClose }: { onClose: () => void }) {
account
);

if (res.success) {
if (res.status === 200) {
setIsFinished(true);
}
};
if (!isLoading && !isProgressLoading && data && ProgressData) {
return (
<Overlay onClick={onClose}>
{!isFinished ? (
<Wrapper>
<Wrapper onClick={(e) => e.stopPropagation()}>
<InputForm onSubmit={handleSubmit(onSubmitHandler)}>
<span className="d-day">D-{data.leftDays}</span>
<span className="bold-36">{data.title}</span>
Expand Down Expand Up @@ -117,7 +117,7 @@ function DonateModal({ onClose }: { onClose: () => void }) {
</InputForm>
</Wrapper>
) : (
<Wrapper>
<Wrapper onClick={(e) => e.stopPropagation()}>
<span className="bold-36">후원이 완료되었습니다.</span>
<span className="medium-20">
{nickname} 후원자님의 보탬이 {data.nickname} 님에게 큰 도움이
Expand Down
2 changes: 1 addition & 1 deletion src/components/SponsorDetail/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 63ed0d4

Please sign in to comment.