This commit is contained in:
@@ -180,7 +180,6 @@ async function upsertCategories() {
|
|||||||
{ name: "메인", slug: "main", sortOrder: 1, status: "active" },
|
{ name: "메인", slug: "main", sortOrder: 1, status: "active" },
|
||||||
{ name: "명예의 전당", slug: "hall-of-fame", sortOrder: 2, status: "active" },
|
{ name: "명예의 전당", slug: "hall-of-fame", sortOrder: 2, status: "active" },
|
||||||
{ name: "소통방", slug: "community", sortOrder: 3, status: "active" },
|
{ name: "소통방", slug: "community", sortOrder: 3, status: "active" },
|
||||||
{ name: "TEST", slug: "test", sortOrder: 4, status: "active" },
|
|
||||||
];
|
];
|
||||||
const map = {};
|
const map = {};
|
||||||
for (const c of categories) {
|
for (const c of categories) {
|
||||||
@@ -352,15 +351,12 @@ async function upsertBoards(admin, categoryMap) {
|
|||||||
{ name: "회원랭킹", slug: "ranking", description: "랭킹", sortOrder: 14 },
|
{ name: "회원랭킹", slug: "ranking", description: "랭킹", sortOrder: 14 },
|
||||||
{ name: "무료쿠폰", slug: "free-coupons", description: "쿠폰", sortOrder: 15 },
|
{ name: "무료쿠폰", slug: "free-coupons", description: "쿠폰", sortOrder: 15 },
|
||||||
{ name: "월간집계", slug: "monthly-stats", description: "월간 통계", sortOrder: 16 },
|
{ name: "월간집계", slug: "monthly-stats", description: "월간 통계", sortOrder: 16 },
|
||||||
// TEST
|
|
||||||
{ name: "TEST", slug: "test", description: "테스트 게시판", sortOrder: 20 },
|
|
||||||
// 광고/제휴 계열 게시판은 제거(메인/명예의전당/소통방 외)
|
// 광고/제휴 계열 게시판은 제거(메인/명예의전당/소통방 외)
|
||||||
];
|
];
|
||||||
|
|
||||||
const created = [];
|
const created = [];
|
||||||
// 텍스트/특수랭킹/특수출석 뷰 타입 ID 조회 (사전에 upsertViewTypes로 생성됨)
|
// 텍스트/특수랭킹/특수출석 뷰 타입 ID 조회 (사전에 upsertViewTypes로 생성됨)
|
||||||
const mainText = await prisma.boardViewType.findUnique({ where: { key: "main_text" } });
|
const mainText = await prisma.boardViewType.findUnique({ where: { key: "main_text" } });
|
||||||
const mainPreview = await prisma.boardViewType.findUnique({ where: { key: "main_preview" } });
|
|
||||||
const listText = await prisma.boardViewType.findUnique({ where: { key: "list_text" } });
|
const listText = await prisma.boardViewType.findUnique({ where: { key: "list_text" } });
|
||||||
const mainSpecial = await prisma.boardViewType.findUnique({ where: { key: "main_special_rank" } });
|
const mainSpecial = await prisma.boardViewType.findUnique({ where: { key: "main_special_rank" } });
|
||||||
const listSpecial = await prisma.boardViewType.findUnique({ where: { key: "list_special_rank" } });
|
const listSpecial = await prisma.boardViewType.findUnique({ where: { key: "list_special_rank" } });
|
||||||
@@ -384,8 +380,6 @@ async function upsertBoards(admin, categoryMap) {
|
|||||||
qna: "community",
|
qna: "community",
|
||||||
tips: "community",
|
tips: "community",
|
||||||
anonymous: "community",
|
anonymous: "community",
|
||||||
// TEST
|
|
||||||
test: "test",
|
|
||||||
// 광고/제휴
|
// 광고/제휴
|
||||||
};
|
};
|
||||||
const categorySlug = mapBySlug[b.slug] || "community";
|
const categorySlug = mapBySlug[b.slug] || "community";
|
||||||
@@ -404,7 +398,6 @@ async function upsertBoards(admin, categoryMap) {
|
|||||||
...(b.slug === "ranking" && mainSpecial ? { mainPageViewTypeId: mainSpecial.id } : {}),
|
...(b.slug === "ranking" && mainSpecial ? { mainPageViewTypeId: mainSpecial.id } : {}),
|
||||||
...(b.slug === "ranking" && listSpecial ? { listViewTypeId: listSpecial.id } : {}),
|
...(b.slug === "ranking" && listSpecial ? { listViewTypeId: listSpecial.id } : {}),
|
||||||
...(b.slug === "attendance" && listSpecialAttendance ? { listViewTypeId: listSpecialAttendance.id } : {}),
|
...(b.slug === "attendance" && listSpecialAttendance ? { listViewTypeId: listSpecialAttendance.id } : {}),
|
||||||
...(b.slug === "test" && mainPreview ? { mainPageViewTypeId: mainPreview.id } : {}),
|
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
name: b.name,
|
name: b.name,
|
||||||
@@ -420,7 +413,6 @@ async function upsertBoards(admin, categoryMap) {
|
|||||||
...(b.slug === "ranking" && mainSpecial ? { mainPageViewTypeId: mainSpecial.id } : {}),
|
...(b.slug === "ranking" && mainSpecial ? { mainPageViewTypeId: mainSpecial.id } : {}),
|
||||||
...(b.slug === "ranking" && listSpecial ? { listViewTypeId: listSpecial.id } : {}),
|
...(b.slug === "ranking" && listSpecial ? { listViewTypeId: listSpecial.id } : {}),
|
||||||
...(b.slug === "attendance" && listSpecialAttendance ? { listViewTypeId: listSpecialAttendance.id } : {}),
|
...(b.slug === "attendance" && listSpecialAttendance ? { listViewTypeId: listSpecialAttendance.id } : {}),
|
||||||
...(b.slug === "test" && mainPreview ? { mainPageViewTypeId: mainPreview.id } : {}),
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
created.push(board);
|
created.push(board);
|
||||||
@@ -567,7 +559,7 @@ async function seedMainpageVisibleBoards(boards) {
|
|||||||
const SETTINGS_KEY = "mainpage_settings";
|
const SETTINGS_KEY = "mainpage_settings";
|
||||||
const setting = await prisma.setting.findUnique({ where: { key: SETTINGS_KEY } });
|
const setting = await prisma.setting.findUnique({ where: { key: SETTINGS_KEY } });
|
||||||
const current = setting ? JSON.parse(setting.value) : {};
|
const current = setting ? JSON.parse(setting.value) : {};
|
||||||
const wantSlugs = new Set(["notice", "free", "ranking", "test"]);
|
const wantSlugs = new Set(["notice", "free", "ranking"]);
|
||||||
const visibleBoardIds = boards.filter((b) => wantSlugs.has(b.slug)).map((b) => b.id);
|
const visibleBoardIds = boards.filter((b) => wantSlugs.has(b.slug)).map((b) => b.id);
|
||||||
const next = { ...current, visibleBoardIds };
|
const next = { ...current, visibleBoardIds };
|
||||||
await prisma.setting.upsert({
|
await prisma.setting.upsert({
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default function HorizontalCardScroller({ items }: HorizontalCardScroller
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="pointer-events-none absolute bottom-[-5px] left-1/2 -translate-x-1/2 z-20 flex items-center gap-6 w-full">
|
<div className="pointer-events-none absolute bottom-[-5px] left-1/2 -translate-x-1/2 z-20 flex items-center justify-center gap-6 w-full">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
aria-label="이전"
|
aria-label="이전"
|
||||||
|
|||||||
Reference in New Issue
Block a user