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
11 changes: 10 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
images: {
remotePatterns: [
{
protocol: "https",
hostname: "placehold.co",
port: "",
pathname: "/**",
},
],
},
};

export default nextConfig;
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "eslint"
},
"dependencies": {
"jwt-decode": "^4.0.0",
"next": "15.5.0",
"postcss": "^8.5.6",
"react": "19.1.0",
Expand All @@ -19,6 +20,7 @@
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4.1.12",
"@types/jwt-decode": "^2.2.1",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
Expand Down
3 changes: 3 additions & 0 deletions public/icons/bookmark-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/bookmark-on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions public/icons/curation-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/icons/freetalk-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/rules_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions src/app/api/free-talk/[postId]/comments/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use server';

import { NextResponse } from 'next/server';

// 간단한 인메모리 저장 (개발/Mock 용). 서버 재시작 시 초기화됨.
// 실제 서비스에서는 DB (Prisma / Drizzle 등) 로 대체.
const commentStore: Record<string, any[]> = {};

// NOTE (Next.js 15): context.params is now async in route handlers for dynamic segments.
// You must await it before accessing properties, otherwise you'll see the
// warning: "`params` should be awaited before using its properties."
export async function POST(
req: Request,
context: { params: Promise<{ postId: string }> }
) {
const { postId } = await context.params;
try {
const body = await req.json();
const { content, parentId, author = '익명다람쥐' } = body || {};
if (!content || typeof content !== 'string') {
return NextResponse.json({ error: '내용이 비어있습니다.' }, { status: 400 });
}
const list = commentStore[postId] || [];
const newComment = {
id: list.length ? list[list.length - 1].id + 1 : 1,
author,
timestamp: new Date().toISOString(),
content,
isHeartSelected: false,
isReply: !!parentId,
parentId: parentId ?? null
};
commentStore[postId] = [...list, newComment];
return NextResponse.json({ ok: true, comment: newComment }, { status: 201 });
} catch (e) {
console.error('Comment POST error', e);
return NextResponse.json({ error: '서버 오류' }, { status: 500 });
}
}

export async function GET(
_req: Request,
context: { params: Promise<{ postId: string }> }
) {
const { postId } = await context.params;
const list = commentStore[postId] || [];
return NextResponse.json({ comments: list }, { status: 200 });
}
47 changes: 0 additions & 47 deletions src/app/api/report/route.ts

This file was deleted.

Loading