Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
guesung committed Jan 26, 2024
1 parent c0746c5 commit 053dae2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/apis/common/apis.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import publicApi from '../config/publicApi';
import { compressImage } from '@/utils/compressImage';

import type { FilesRequest, FilesResponse } from '.';

export const postFiles = async ({ fileList }: FilesRequest) => {
const formData = new FormData();

alert('파일 업로드 중입니다. 잠시만 기다려주세요.');

const compressedFileList = await Promise.all(fileList.map((file) => compressImage(file)));

alert('파일 업로드가 완료되었습니다.');
compressedFileList.forEach((file) => {
fileList.forEach((file) => {
formData.append('fileList', file);
});
alert('파일 업로드 중입니다. 잠시만 기다려주세요.2222');

return publicApi.post<FilesResponse>('/files', formData, {
headers: {
Expand Down

0 comments on commit 053dae2

Please sign in to comment.