게시판 유형 삭제
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -20,7 +20,6 @@ export async function GET(req: Request) {
|
||||
name: true,
|
||||
slug: true,
|
||||
description: true,
|
||||
type: true,
|
||||
requiresApproval: true,
|
||||
allowAnonymousPost: true,
|
||||
isAdultOnly: true,
|
||||
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user