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: 광고 구좌 변경 #1709

Merged
merged 2 commits into from
Dec 21, 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
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
Loading