Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#404] presignedUrl 응답 타입 변경 #405

Merged
merged 5 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
};
}

Comment on lines +15 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5) 깔끔하게 기존 타입 활용해서 잘 정의했네요 굿굿

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
Loading