Skip to content
Open
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
37 changes: 0 additions & 37 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions app/api/admin/comments/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export async function GET() {
Accept: 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
},
cache: 'no-store',
}
);

Expand Down Expand Up @@ -111,6 +112,7 @@ export async function GET() {
Accept: 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
},
cache: 'no-store',
}
);

Expand Down
5 changes: 3 additions & 2 deletions app/api/atelier/messages/[id]/reaction/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import BlockedFingerprint from '@/app/models/BlockedFingerprint';
import { ATELIER_EMOJIS, ReactionBucket } from '@/app/types/Atelier';

interface RouteParams {
params: { id: string };
params: Promise<{ id: string }>;
}

// 허용 이모지 화이트리스트
const allowedEmojiSet = new Set<string>(ATELIER_EMOJIS);

export const POST = async (request: Request, { params }: RouteParams) => {
export const POST = async (request: Request, props: RouteParams) => {
const params = await props.params;
try {
await dbConnect();

Expand Down
11 changes: 7 additions & 4 deletions app/api/atelier/messages/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import dbConnect from '@/app/lib/dbConnect';
import AtelierMessage from '@/app/models/AtelierMessage';

interface RouteParams {
params: { id: string };
params: Promise<{ id: string }>;
}

export const DELETE = async (request: Request, { params }: RouteParams) => {
export const DELETE = async (request: Request, props: RouteParams) => {
const params = await props.params;
try {
await dbConnect();

Expand Down Expand Up @@ -78,7 +79,8 @@ export const DELETE = async (request: Request, { params }: RouteParams) => {
}
};

export const PATCH = async (request: Request, { params }: RouteParams) => {
export const PATCH = async (request: Request, props: RouteParams) => {
const params = await props.params;
try {
await dbConnect();

Expand Down Expand Up @@ -139,7 +141,8 @@ export const PATCH = async (request: Request, { params }: RouteParams) => {
}
};

export const PUT = async (request: Request, { params }: RouteParams) => {
export const PUT = async (request: Request, props: RouteParams) => {
const params = await props.params;
try {
await dbConnect();

Expand Down
5 changes: 3 additions & 2 deletions app/api/atelier/messages/[id]/thread/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import dbConnect from '@/app/lib/dbConnect';
import AtelierMessage from '@/app/models/AtelierMessage';

interface RouteParams {
params: { id: string };
params: Promise<{ id: string }>;
}

export const GET = async (request: Request, { params }: RouteParams) => {
export const GET = async (request: Request, props: RouteParams) => {
const params = await props.params;
try {
await dbConnect();

Expand Down
1 change: 1 addition & 0 deletions app/api/opengraph/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const GET = async (request: Request) => {
Accept: 'text/html,application/xhtml+xml',
},
signal: AbortSignal.timeout(5000),
next: { revalidate: 3600 },
});

if (!res.ok)
Expand Down
6 changes: 2 additions & 4 deletions app/api/portfolio/[slug]/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { portfolioData } from '@/app/api/portfolio/data';

export async function GET(
request: Request,
{ params }: { params: { slug: string } }
) {
export async function GET(request: Request, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
const slug = params.slug?.toLowerCase();

Expand Down
18 changes: 6 additions & 12 deletions app/api/posts/[slug]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import Post from '@/app/models/Post';
import Series from '@/app/models/Series';

export async function GET(
req: NextRequest,
{ params }: { params: { slug: string } }
) {
export async function GET(req: NextRequest, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
await dbConnect();
const post = await Post.findOne({ slug: params.slug }).lean();
Expand Down Expand Up @@ -40,10 +38,8 @@
}
}

export async function PUT(
req: NextRequest,
{ params }: { params: { slug: string } }
) {
export async function PUT(req: NextRequest, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
// 글 수정은 관리자 전용
const session = await getServerSession();
Expand Down Expand Up @@ -109,10 +105,8 @@
}
}

export async function DELETE(
request: Request,
{ params }: { params: { slug: string } }
) {
export async function DELETE(request: Request, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
// 글 삭제는 관리자 전용
const session = await getServerSession();
Expand Down Expand Up @@ -145,7 +139,7 @@
return NextResponse.json({
message: '포스트가 성공적으로 삭제되었습니다.',
});
} catch (error: any) {

Check warning on line 142 in app/api/posts/[slug]/route.ts

View workflow job for this annotation

GitHub Actions / Continuous Integration

Unexpected any. Specify a different type
return NextResponse.json(
{ error: error.message || '포스트 삭제에 실패했습니다.' },
{ status: 500 }
Expand Down
18 changes: 6 additions & 12 deletions app/api/series/[slug]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import Series from '@/app/models/Series';
import '@/app/models/Post';

export async function GET(
request: Request,
{ params }: { params: { slug: string } }
) {
export async function GET(request: Request, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
await dbConnect();

Expand All @@ -30,7 +28,7 @@
'Cache-Control': 'public, max-age=60, s-maxage=60',
},
});
} catch (error: any) {

Check warning on line 31 in app/api/series/[slug]/route.ts

View workflow job for this annotation

GitHub Actions / Continuous Integration

Unexpected any. Specify a different type
return NextResponse.json(
{ error: error.message || '시리즈 조회에 실패했습니다.' },
{ status: 500 }
Expand All @@ -38,10 +36,8 @@
}
}

export async function PUT(
request: Request,
{ params }: { params: { slug: string } }
) {
export async function PUT(request: Request, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
const session = await getServerSession();

Expand Down Expand Up @@ -73,7 +69,7 @@
}

return NextResponse.json(updatedSeries);
} catch (error: any) {

Check warning on line 72 in app/api/series/[slug]/route.ts

View workflow job for this annotation

GitHub Actions / Continuous Integration

Unexpected any. Specify a different type
return NextResponse.json(
{ error: error.message || '시리즈 수정에 실패했습니다.' },
{ status: 500 }
Expand All @@ -81,10 +77,8 @@
}
}

export async function DELETE(
request: Request,
{ params }: { params: { slug: string } }
) {
export async function DELETE(request: Request, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
try {
const session = await getServerSession();

Expand All @@ -106,7 +100,7 @@
return NextResponse.json({
message: '시리즈가 성공적으로 삭제되었습니다.',
});
} catch (error: any) {

Check warning on line 103 in app/api/series/[slug]/route.ts

View workflow job for this annotation

GitHub Actions / Continuous Integration

Unexpected any. Specify a different type
return NextResponse.json(
{ error: error.message || '시리즈 삭제에 실패했습니다.' },
{ status: 500 }
Expand Down
2 changes: 1 addition & 1 deletion app/api/subscribe/unsubscribe/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isRedirectError } from 'next/dist/client/components/redirect';
import { isRedirectError } from 'next/dist/client/components/redirect-error';
import { redirect } from 'next/navigation';
import { NextRequest } from 'next/server';
import dbConnect from '@/app/lib/dbConnect';
Expand Down
2 changes: 1 addition & 1 deletion app/api/subscribe/verify/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isRedirectError } from 'next/dist/client/components/redirect';
import { isRedirectError } from 'next/dist/client/components/redirect-error';
import { redirect } from 'next/navigation';
import { NextRequest } from 'next/server';
import dbConnect from '@/app/lib/dbConnect';
Expand Down
2 changes: 1 addition & 1 deletion app/entities/atelier/ThreadPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const ThreadPanel = ({
}
};
fetchThread();
}, [parentId]); // eslint-disable-line react-hooks/exhaustive-deps
}, [parentId]);

const handleSend = async (content: string) => {
if (author.needsNickname) {
Expand Down
3 changes: 2 additions & 1 deletion app/entities/common/Toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { CiCircleCheck, CiCircleRemove, CiMail } from 'react-icons/ci';

type ToastType = 'success' | 'error' | 'info';
Expand All @@ -9,7 +10,7 @@ interface ToastProps {
removeToast: () => void;
}

const iconMap: Record<ToastType, JSX.Element> = {
const iconMap: Record<ToastType, React.JSX.Element> = {
success: <CiCircleCheck color={'green'} size={40} />,
error: <CiCircleRemove color={'red'} size={40} />,
info: <CiMail color={'#3b82f6'} size={40} />,
Expand Down
10 changes: 2 additions & 8 deletions app/entities/portfolio/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ const Carousel = ({ slides }: CarouselProps) => {
? currentSlides.length - 1
: currentIndex - 1
] as ReactElement,
{
hideTags: true,

}
{ hideTags: true } as Record<string, unknown>
)}
</div>
)}
Expand All @@ -195,10 +192,7 @@ const Carousel = ({ slides }: CarouselProps) => {
? 0
: currentIndex + 1
] as ReactElement,
{
hideTags: true,

}
{ hideTags: true } as Record<string, unknown>
)}
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion app/entities/post/detail/PostTOC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ const PostTOC = ({ postContent }: { postContent: string }) => {
observer.disconnect();
window.removeEventListener('scroll', onScroll);
};
}, [postContent]); // eslint-disable-line react-hooks/exhaustive-deps
}, [postContent]);

/* ── Rail fill height (animate on active change) ────── */
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/dbConnect.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mongoose, { Mongoose } from 'mongoose';

declare global {
// eslint-disable-next-line no-var
var mongoose: {
conn: Mongoose | null;
promise: Promise<Mongoose> | null;
Expand Down
12 changes: 6 additions & 6 deletions app/portfolio/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ import { portfolioData } from '@/app/api/portfolio/data';
import PortfolioDetailClient from './PortfolioDetailClient';

interface PortfolioDetailPageProps {
params: {
params: Promise<{
slug: string;
};
}>;
}

const baseUrl =
process.env.NEXT_PUBLIC_DEPLOYMENT_URL || 'https://shipfriend.dev';

export async function generateMetadata({
params,
}: PortfolioDetailPageProps): Promise<Metadata> {
export async function generateMetadata(props: PortfolioDetailPageProps): Promise<Metadata> {
const params = await props.params;
const portfolio = portfolioData[params.slug as keyof typeof portfolioData];

if (!portfolio) {
Expand Down Expand Up @@ -50,7 +49,8 @@ export async function generateMetadata({
};
}

const PortfolioDetailPage = ({ params }: PortfolioDetailPageProps) => {
const PortfolioDetailPage = async (props: PortfolioDetailPageProps) => {
const params = await props.params;
return <PortfolioDetailClient params={params} />;
};

Expand Down
6 changes: 2 additions & 4 deletions app/posts/[slug]/llms.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import Post from '@/app/models/Post';

export const revalidate = 300;

export async function GET(
_req: Request,
{ params }: { params: { slug: string } }
) {
export async function GET(_req: Request, props: { params: Promise<{ slug: string }> }) {
const params = await props.params;
await dbConnect();

const post = await Post.findOne({
Expand Down
14 changes: 8 additions & 6 deletions app/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ async function getPostDetail(slug: string) {
return { post: JSON.parse(JSON.stringify(post)) };
}

export const generateMetadata = async ({
params,
}: {
params: { slug: string };
}): Promise<Metadata> => {
export const generateMetadata = async (
props: {
params: Promise<{ slug: string }>;
}
): Promise<Metadata> => {
const params = await props.params;
const { post } = await getPostDetail(params.slug);
const baseUrl =
process.env.NEXT_PUBLIC_DEPLOYMENT_URL || 'https://shipfriend.dev';
Expand Down Expand Up @@ -83,7 +84,8 @@ export const generateMetadata = async ({
};
};

const BlogDetailPage = async ({ params }: { params: { slug: string } }) => {
const BlogDetailPage = async (props: { params: Promise<{ slug: string }> }) => {
const params = await props.params;
const { post } = await getPostDetail(params.slug);
return (
<>
Expand Down
13 changes: 7 additions & 6 deletions app/series/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { Series } from '@/app/types/Series';

interface LayoutProps {
children: React.ReactNode;
params: { slug: string };
params: Promise<{ slug: string }>;
}

export async function generateMetadata({
params,
}: {
params: { slug: string };
}): Promise<Metadata> {
export async function generateMetadata(
props: {
params: Promise<{ slug: string }>;
}
): Promise<Metadata> {
const params = await props.params;
const baseUrl =
process.env.NEXT_PUBLIC_DEPLOYMENT_URL || 'https://shipfriend.dev';

Expand Down
Loading
Loading