Skip to content

Commit

Permalink
feat: 광고 구좌 변경 (#1709)
Browse files Browse the repository at this point in the history
* chore: 디바운싱 임시 주석 처리

* feat: 1222 광고 구좌 변경
  • Loading branch information
seojisoosoo authored Dec 21, 2024
1 parent ad956a2 commit 8479bd6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
8 changes: 4 additions & 4 deletions src/components/common/Banner/AdsBanner/constants/ads.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const ADS = [
{
// 이현진
// 송승훈
id: 1,
moImage:
'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241124-20241207/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+(%E1%84%86%E1%85%A9%E1%84%87%E1%85%A1%E1%84%8B%E1%85%B5%E1%86%AF+%E1%84%87%E1%85%A5%E1%84%8C%E1%85%A5%E1%86%AB).png',
'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241222-/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+%E1%84%89%E1%85%A1%E1%86%BC%E1%84%83%E1%85%A1%E1%86%AB%E1%84%87%E1%85%A2%E1%84%82%E1%85%A5+(MO)_%E1%84%8E%E1%85%AC%E1%84%8C%E1%85%A9%E1%86%BC.png',
pcImage:
'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241124-20241207/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+(PC+%E1%84%87%E1%85%A5%E1%84%8C%E1%85%A5%E1%86%AB).png',
url: 'https://playground.sopt.org/group/detail?id=394&fbclid=PAZXh0bgNhZW0CMTEAAabm-2g8SKZjOhiJs17TJxwrBRLjAek6f3rxg89MpBrhCFR_KHvZ8DMZu3M_aem_H1uBBjFciE9mA3RMayJTfA',
'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241222-/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+%E1%84%89%E1%85%A1%E1%86%BC%E1%84%83%E1%85%A1%E1%86%AB%E1%84%87%E1%85%A2%E1%84%82%E1%85%A5+(PC)_%E1%84%8E%E1%85%AC%E1%84%8C%E1%85%A9%E1%86%BC.png',
url: 'https://www.miricanvas.com/campaign/end_of_year_2024?from=event_sopt',
},
{
// 메이커스 마케팅 오거나이저
Expand Down
47 changes: 23 additions & 24 deletions src/hooks/useImageUploader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import debounce from 'lodash-es/debounce';
import { useRef } from 'react';

import { getPresignedUrl, putPresignedUrl } from '@/api/endpoint/common/image';
Expand Down Expand Up @@ -26,33 +25,33 @@ export default function useImageUploader({ onSuccess, resizeHeight }: Options) {
// : await Promise.all(Array.from(inputEl.files).map((file) => tryResizeFile(file, resizeHeight)));
const files = inputEl.files;

const uploadFiles = debounce(async () => {
const urls: string[] = [];
// const uploadFiles = debounce(async () => {
const urls: string[] = [];

await Promise.all(
Array.from(files).map(async (file) => {
try {
const { filename, signedUrl } = await getPresignedUrl.request({ filename: file.name });
if (!signedUrl) {
throw new Error('presigned-url을 받아오는데 실패하였습니다.');
}
await Promise.all(
Array.from(files).map(async (file) => {
try {
const { filename, signedUrl } = await getPresignedUrl.request({ filename: file.name });
if (!signedUrl) {
throw new Error('presigned-url을 받아오는데 실패하였습니다.');
}

await putPresignedUrl({
signedUrl: decodeURIComponent(signedUrl),
file,
});
await putPresignedUrl({
signedUrl: decodeURIComponent(signedUrl),
file,
});

const s3Url = `https://s3.ap-northeast-2.amazonaws.com/sopt-makers-internal/${filename}`;
urls.push(s3Url);
} catch (error) {
console.error(error);
}
}),
);
onSuccess?.(urls);
}, 500);
const s3Url = `https://s3.ap-northeast-2.amazonaws.com/sopt-makers-internal/${filename}`;
urls.push(s3Url);
} catch (error) {
console.error(error);
}
}),
);
onSuccess?.(urls);
// }, 500);

uploadFiles();
// uploadFiles();
};

inputEl.click();
Expand Down

0 comments on commit 8479bd6

Please sign in to comment.