관리자페이지 작업

This commit is contained in:
mota
2025-10-31 16:27:04 +09:00
parent f444888f2d
commit 0827352e6b
14 changed files with 704 additions and 105 deletions

View File

@@ -207,6 +207,28 @@ async function upsertBoards(admin, categoryMap) {
return created;
}
async function upsertViewTypes() {
const viewTypes = [
// main scope
{ key: "main_default", name: "기본", scope: "main" },
{ key: "main_text", name: "텍스트", scope: "main" },
{ key: "main_preview", name: "미리보기", scope: "main" },
{ key: "main_special_rank", name: "특수랭킹", scope: "main" },
// list scope
{ key: "list_default", name: "기본", scope: "list" },
{ key: "list_text", name: "텍스트", scope: "list" },
{ key: "list_preview", name: "미리보기", scope: "list" },
{ key: "list_special_rank", name: "특수랭킹", scope: "list" },
];
for (const vt of viewTypes) {
await prisma.boardViewType.upsert({
where: { key: vt.key },
update: { name: vt.name, scope: vt.scope },
create: vt,
});
}
}
async function seedPolicies() {
// 금칙어 예시
const banned = [
@@ -241,6 +263,7 @@ async function main() {
await upsertRoles();
const admin = await upsertAdmin();
const categoryMap = await upsertCategories();
await upsertViewTypes();
const boards = await upsertBoards(admin, categoryMap);
// 샘플 글 하나