Fix training plan generation flow
这个提交包含在:
@@ -146,9 +146,9 @@ export async function getUserTrainingPlans(userId: number) {
|
||||
|
||||
export async function getActivePlan(userId: number) {
|
||||
const db = await getDb();
|
||||
if (!db) return undefined;
|
||||
if (!db) return null;
|
||||
const result = await db.select().from(trainingPlans).where(and(eq(trainingPlans.userId, userId), eq(trainingPlans.isActive, 1))).limit(1);
|
||||
return result.length > 0 ? result[0] : undefined;
|
||||
return result.length > 0 ? result[0] : null;
|
||||
}
|
||||
|
||||
export async function updateTrainingPlan(planId: number, data: Partial<InsertTrainingPlan>) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户