diff --git a/next.config.ts b/next.config.ts
index 680c176..9d20e0c 100644
--- a/next.config.ts
+++ b/next.config.ts
@@ -5,14 +5,18 @@ const nextConfig: NextConfig = {
scrollRestoration: false,
},
images: {
- domains: ['team2-app-s3-bucket.s3.ap-northeast-2.amazonaws.com'],
+ // 외부 이미지 최적화 완전 비활성화 (Vercel 유료 기능 회피)
+ unoptimized: true,
+ domains: [
+ 'team2-app-s3-bucket.s3.ap-northeast-2.amazonaws.com',
+ 'team2-app-s3-bucket.s3.amazonaws.com',
+ ],
remotePatterns: [
{
protocol: 'https',
hostname: 'www.thecocktaildb.com',
},
],
- qualities: [25, 50, 75, 90, 100],
},
env: {
NPUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
diff --git a/src/domains/community/components/post-info/PostInfo.tsx b/src/domains/community/components/post-info/PostInfo.tsx
index c2d3f87..e6dc048 100644
--- a/src/domains/community/components/post-info/PostInfo.tsx
+++ b/src/domains/community/components/post-info/PostInfo.tsx
@@ -17,7 +17,7 @@ function PostInfo({
}: Props) {
return (
{hasUserName && (
diff --git a/src/domains/community/write/CompleteBtn.tsx b/src/domains/community/write/CompleteBtn.tsx
index 9c7c913..2240d4f 100644
--- a/src/domains/community/write/CompleteBtn.tsx
+++ b/src/domains/community/write/CompleteBtn.tsx
@@ -3,20 +3,28 @@ import Button from '@/shared/components/button/Button';
type Props = {
mode: 'edit' | 'create';
setEditDone: (value: boolean) => void;
+ isLoading?: boolean;
};
-function CompleteBtn({ mode, setEditDone }: Props) {
+function CompleteBtn({ mode, setEditDone, isLoading = false }: Props) {
return (
);
diff --git a/src/domains/community/write/WriteSection.tsx b/src/domains/community/write/WriteSection.tsx
index 5e5dfe1..cdf447c 100644
--- a/src/domains/community/write/WriteSection.tsx
+++ b/src/domains/community/write/WriteSection.tsx
@@ -153,6 +153,7 @@ function WriteSection({ mode, postId }: Props) {
payload.append('post', postBlob);
try {
+ setIsLoading(true);
const res = await fetch(`${getApi}/posts`, {
method: 'POST',
credentials: 'include',
@@ -161,10 +162,17 @@ function WriteSection({ mode, postId }: Props) {
if (res.ok) {
router.push('/community');
+ } else {
+ // 서버 에러 응답 처리
+ const errorData = await res.json().catch(() => ({}));
+ const errorMessage = errorData.message || `서버 오류가 발생했습니다. (${res.status})`;
+ toastError(errorMessage);
}
} catch (err) {
console.error('글작성 폼 작성 에러', err);
- return;
+ toastError('네트워크 오류가 발생했습니다. 다시 시도해주세요.');
+ } finally {
+ setIsLoading(false);
}
};
@@ -275,14 +283,14 @@ function WriteSection({ mode, postId }: Props) {
e.preventDefault();
};
- if (isEditLoading) ;
+ if (isEditLoading) return ;
- if (isLoading) ;
+ if (isLoading) return ;
return (
<>