게시판 유형 삭제

This commit is contained in:
koreacomp5
2025-11-02 03:12:42 +09:00
parent 0bf18968ad
commit d057ebef4a
8 changed files with 16 additions and 34 deletions

View File

@@ -369,7 +369,6 @@ export default function AdminBoardsPage() {
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"></th>
<th className="px-3 py-2"> </th>
<th className="px-3 py-2"></th>
@@ -503,12 +502,6 @@ function BoardRowCells({ b, onDirty, onDelete, allowMove, categories, onMove, ma
<td className="px-3 py-2 text-center"><input type="checkbox" checked={edit.allowAnonymousPost} onChange={(e) => { const v = { ...edit, allowAnonymousPost: e.target.checked }; setEdit(v); onDirty(b.id, v); }} /></td>
<td className="px-3 py-2 text-center"><input type="checkbox" checked={edit.allowSecretComment} onChange={(e) => { const v = { ...edit, allowSecretComment: e.target.checked }; setEdit(v); onDirty(b.id, v); }} /></td>
<td className="px-3 py-2 text-center"><input type="checkbox" checked={edit.requiresApproval} onChange={(e) => { const v = { ...edit, requiresApproval: e.target.checked }; setEdit(v); onDirty(b.id, v); }} /></td>
<td className="px-3 py-2 text-center">
<select className="h-9 rounded-md border border-neutral-300 px-2 text-sm" value={edit.type} onChange={(e) => { const v = { ...edit, type: e.target.value }; setEdit(v); onDirty(b.id, v); }}>
<option value="general">general</option>
<option value="special">special</option>
</select>
</td>
<td className="px-3 py-2 text-center"><input type="checkbox" checked={!!edit.isAdultOnly} onChange={(e) => { const v = { ...edit, isAdultOnly: e.target.checked }; setEdit(v); onDirty(b.id, v); }} /></td>
{allowMove && categories && onMove ? (
<td className="px-3 py-2 text-center">

View File

@@ -5,7 +5,7 @@ export async function PATCH(req: Request, context: { params: Promise<{ id: strin
const { id } = await context.params;
const body = await req.json().catch(() => ({}));
const data: any = {};
for (const k of ["name", "slug", "description", "sortOrder", "readLevel", "writeLevel", "allowAnonymousPost", "allowSecretComment", "requiresApproval", "status", "type", "isAdultOnly", "categoryId", "mainPageViewTypeId", "listViewTypeId"]) {
for (const k of ["name", "slug", "description", "sortOrder", "readLevel", "writeLevel", "allowAnonymousPost", "allowSecretComment", "requiresApproval", "status", "isAdultOnly", "categoryId", "mainPageViewTypeId", "listViewTypeId"]) {
if (k in body) data[k] = body[k];
}
if ("requiredTags" in body) {

View File

@@ -17,7 +17,6 @@ export async function GET() {
allowAnonymousPost: true,
allowSecretComment: true,
requiresApproval: true,
type: true,
status: true,
categoryId: true,
mainPageViewTypeId: true,
@@ -39,7 +38,6 @@ const createSchema = z.object({
allowSecretComment: z.boolean().optional(),
requiresApproval: z.boolean().optional(),
status: z.string().optional(),
type: z.string().optional(),
isAdultOnly: z.boolean().optional(),
categoryId: z.string().nullable().optional(),
});

View File

@@ -20,7 +20,6 @@ export async function GET(req: Request) {
name: true,
slug: true,
description: true,
type: true,
requiresApproval: true,
allowAnonymousPost: true,
isAdultOnly: true,

View File

@@ -10,7 +10,7 @@ export async function GET() {
boards: {
where: { status: "active" },
orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }],
select: { id: true, name: true, slug: true, requiresApproval: true, type: true },
select: { id: true, name: true, slug: true, requiresApproval: true },
},
},
});

View File

@@ -7,7 +7,7 @@ type ApiCategory = {
id: string;
name: string;
slug: string;
boards: { id: string; name: string; slug: string; type: string; requiresApproval: boolean }[];
boards: { id: string; name: string; slug: string; requiresApproval: boolean }[];
};
type PostItem = {