Skip to content

Commit

Permalink
feat: overview section in study category
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <zhangtianli2006@163.com>
  • Loading branch information
ZTL-UwU committed Jul 20, 2024
1 parent 039d768 commit d45f96a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const secondaryCategorySchema = z.enum([
'compulsories',
'life',
'study',
'overview',
]);

export const categoryMap: Array<ICategory> = [{
Expand Down Expand Up @@ -50,6 +51,9 @@ export const categoryMap: Array<ICategory> = [{
icon: 'lucide:book-marked',
to: '/study',
secondary: [{
value: 'overview',
name: '总体介绍',
}, {
value: 'humanities',
name: '文科',
}, {
Expand Down
2 changes: 1 addition & 1 deletion server/database/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
3 changes: 2 additions & 1 deletion types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export type TSecondaryCategory =
'science' |
'compulsories' |
'life' |
'study';
'study' |
'overview';

export interface ICategory {
value: TPrimaryCategory;
Expand Down

0 comments on commit d45f96a

Please sign in to comment.