refactor: P0-1/2/4 解耦修复 - 拆分过耦合文件 + dashboard 解耦
This commit is contained in:
@@ -127,3 +127,12 @@ export const getQuestions = cache(async ({
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export type QuestionsDashboardStats = {
|
||||
questionCount: number
|
||||
}
|
||||
|
||||
export const getQuestionsDashboardStats = cache(async (): Promise<QuestionsDashboardStats> => {
|
||||
const [row] = await db.select({ value: count() }).from(questions)
|
||||
return { questionCount: Number(row?.value ?? 0) }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user