KO
베타 번역

@core / comments

1.0.1 ▾
인증됨MIT
GitHub

모든 엔티티에 대한 검토 댓글: 게스트/사용자, 답글, 1–5 평점, 차단, GDPR 삭제, 안전한 HTML

코드파일 9개컨텍스트약 552토큰검사 통과

.genpmignore 적용 후 주입될 정확한 트리입니다. 고정 대상:

src/lib/comments/adapters/next.ts읽기 전용 · abfbbe8
// Adaptador Next.js: `app/api/comments/[type]/[id]/route.ts` →
//   export const { GET, POST } = commentRoute({ currentUser: async () => getUser(await cookies()) });
import type { Moderation } from '../index.ts';
import { type CurrentUser, handleList, handlePost } from './http.ts';

type Ctx = { params: Promise<{ type: string; id: string }> };

export function commentRoute(opts: { currentUser: CurrentUser; moderation?: Moderation }) {
  return {
    GET: async (req: Request, ctx: Ctx) => {
      const { type, id } = await ctx.params;
      return handleList(req, type, id);
    },
    POST: async (req: Request, ctx: Ctx) => {
      const { type, id } = await ctx.params;
      return handlePost(req, type, id, opts);
    },
  };
}

@core/comments 신고

패키지를 신고하려면 GitHub로 로그인하세요.