Skip to content

Commit

Permalink
Merge pull request #899 from sopt-makers/develop
Browse files Browse the repository at this point in the history
모임 상세 조회 API 마이그레이션 배포
  • Loading branch information
j-nary authored Oct 1, 2024
2 parents 19bdebb + 01ab1de commit 8d4f9e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
17 changes: 3 additions & 14 deletions src/api/API_LEGACY/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,10 @@ export const updateMeeting = async (meetingId: string, formData: FormType) => {
return response;
};

interface GetPresignedUrlResponse {
url: string;
fields: {
'Content-Type': string;
key: string;
bucket: string;
'X-Amz-Algorithm': string;
'X-Amz-Credential': string;
'X-Amz-Date': string;
Policy: string;
'X-Amz-Signature': string;
};
}
type GetPresignedUrlResponse =
paths['/meeting/v2/presigned-url']['get']['responses']['200']['content']['application/json;charset=UTF-8'];
export const getPresignedUrl = async (contentType: string) => {
const { data } = await api.get<Data<GetPresignedUrlResponse>>('/meeting/v1/presigned-url', {
const { data } = await api.get<GetPresignedUrlResponse>('/meeting/v2/presigned-url', {
params: { contentType },
});
return data;
Expand Down
4 changes: 1 addition & 3 deletions src/components/feed/Modal/FeedFormPresentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ function FeedFormPresentation({

const uploadFile = async (file: File) => {
const extension = file.type.split('/')[1];
const {
data: { url, fields },
} = await getPresignedUrl(extension);
const { url, fields } = await getPresignedUrl(extension);
await uploadImage(file, url, fields);
const imageUrls = imageS3Bucket + fields.key;
return imageUrls;
Expand Down
4 changes: 1 addition & 3 deletions src/components/form/Presentation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ function Presentation({

const uploadFile = async (file: File) => {
const extension = file.type.split('/')[1];
const {
data: { url, fields },
} = await getPresignedUrl(extension);
const { url, fields } = await getPresignedUrl(extension);
await uploadImage(file, url, fields);
const imageUrls = imageS3Bucket + fields.key;
return imageUrls;
Expand Down

0 comments on commit 8d4f9e1

Please sign in to comment.