Skip to content

Commit

Permalink
Merge pull request #405 from TEAM-BEAT/feat/#404/FixPresignedUrl
Browse files Browse the repository at this point in the history
[Feat/#404] presignedUrl 응답 타입 변경
  • Loading branch information
imddoy authored Sep 13, 2024
2 parents 60a6e07 + 2e16c25 commit 5a6c165
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/apis/domains/files/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ export interface PresignedResponse {
performance: ImageInterface;
}

export interface PresignedAllResponse {
status: number;
message: string;
data: {
performanceMakerPresignedUrls: PresignedResponse;
};
}

export interface GetPresignedUrlParams {
posterImage: string;
castImages: string[];
Expand All @@ -30,7 +38,7 @@ export const getPresignedUrl = async (
performImages: params.performanceImages.length === 0 ? [""] : params.performanceImages,
};

const response: AxiosResponse<PresignedResponse> = await get("/files/presigned-url", {
const response: AxiosResponse<PresignedAllResponse> = await get("/files/presigned-url", {
params: paramsWithEmptyArrays,
paramsSerializer: (params) => {
const searchParams = new URLSearchParams();
Expand All @@ -48,7 +56,7 @@ export const getPresignedUrl = async (
},
});

return response.data;
return response.data.data.performanceMakerPresignedUrls;
} catch (error) {
console.error("error", error);
return null;
Expand Down
1 change: 0 additions & 1 deletion src/pages/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ const Register = () => {
performanceImage: performanceUrls[index] || image.performanceImage,
})),
};
console.log(formData);
try {
await postPerformance(formData);
} catch (err) {
Expand Down

0 comments on commit 5a6c165

Please sign in to comment.