From d45f96ad0b4957dc27ac3218232543c385313b9f Mon Sep 17 00:00:00 2001 From: ZTL-UwU Date: Sun, 21 Jul 2024 01:21:07 +0800 Subject: [PATCH] feat: overview section in study category Signed-off-by: ZTL-UwU --- constants/index.ts | 4 ++++ server/database/schema.ts | 2 +- types/index.ts | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/constants/index.ts b/constants/index.ts index f570935..2b18985 100644 --- a/constants/index.ts +++ b/constants/index.ts @@ -19,6 +19,7 @@ export const secondaryCategorySchema = z.enum([ 'compulsories', 'life', 'study', + 'overview', ]); export const categoryMap: Array = [{ @@ -50,6 +51,9 @@ export const categoryMap: Array = [{ icon: 'lucide:book-marked', to: '/study', secondary: [{ + value: 'overview', + name: '总体介绍', + }, { value: 'humanities', name: '文科', }, { diff --git a/server/database/schema.ts b/server/database/schema.ts index 28acad7..e7629ab 100644 --- a/server/database/schema.ts +++ b/server/database/schema.ts @@ -5,7 +5,7 @@ export const guidebook = sqliteTable('guidebook', { content: text('content').notNull(), primaryCategory: text('primaryCategory', { enum: ['life', 'study', 'tips', 'intl'] }).notNull(), secondaryCategory: text('secondaryCategory', { - enum: ['library', 'activity', 'dorm', 'food', 'club', 'humanities', 'science', 'compulsories', 'life', 'study'], + enum: ['library', 'activity', 'dorm', 'food', 'club', 'humanities', 'science', 'compulsories', 'life', 'study', 'overview'], }).notNull(), isReviewed: integer('is_reviewed', { mode: 'boolean' }).default(false).notNull(), }); diff --git a/types/index.ts b/types/index.ts index 1935cb5..0e19463 100644 --- a/types/index.ts +++ b/types/index.ts @@ -15,7 +15,8 @@ export type TSecondaryCategory = 'science' | 'compulsories' | 'life' | - 'study'; + 'study' | + 'overview'; export interface ICategory { value: TPrimaryCategory;