Merge remote-tracking branch 'origin/wt/sweep-B' into integration/sweep-fixes

This commit is contained in:
2026-08-06 13:57:53 +00:00
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ export async function getGraphData(domainId: string): Promise<GraphData> {
}
// Fetch all entities in this domain
const projectIds = (await db.select({ id: projects.id }).from(projects).where(eq(projects.domainId, domainId))).map(p => p.id);
const projectIds = (await db.select({ id: projects.id }).from(projects).where(and(eq(projects.domainId, domainId), isNull(projects.deletedAt)))).map(p => p.id);
const [noteRows, taskRows, habitRows, projectRows, sectionRows, tagRows, domainRows] = await Promise.all([
db.select({ id: notes.id, title: notes.title }).from(notes).where(and(eq(notes.domainId, domainId), isNull(notes.deletedAt))),
db.select({ id: tasks.id, title: tasks.title, projectId: tasks.projectId }).from(tasks).where(and(eq(tasks.domainId, domainId), isNull(tasks.deletedAt))),
+5 -5
View File
@@ -1,4 +1,4 @@
import { createAdminClient } from '../pocketbase';
import { createAdminClient, createPocketBaseClient } from '../pocketbase';
import type {
Task,
Habit,
@@ -46,7 +46,7 @@ export async function generateWeeklySummary(
streaks: Array<{ name: string; streak: number }>;
byDomain: Record<string, { tasks: number; habits: number }>;
}> {
const pb = token ? createAdminClient() : createAdminClient();
const pb = token ? createPocketBaseClient(token) : createAdminClient();
// Tasks completed this week
const taskResults = await pb.collection('tasks').getFullList({
@@ -112,7 +112,7 @@ export async function generateProjectHealth(
milestoneStatus: Record<string, number>;
completionRate: number;
}> {
const pb = token ? createAdminClient() : createAdminClient();
const pb = token ? createPocketBaseClient(token) : createAdminClient();
const taskResults = await pb.collection('tasks').getFullList({
filter: `project_id = "${projectId}"`,
@@ -169,7 +169,7 @@ export async function generateHabitAnalysis(
}>;
atRiskHabits: string[];
}> {
const pb = token ? createAdminClient() : createAdminClient();
const pb = token ? createPocketBaseClient(token) : createAdminClient();
const startDate = new Date();
startDate.setDate(startDate.getDate() - days);
@@ -225,7 +225,7 @@ export async function generateTimeAudit(
byProject: Record<string, number>;
byTag: Record<string, number>;
}> {
const pb = token ? createAdminClient() : createAdminClient();
const pb = token ? createPocketBaseClient(token) : createAdminClient();
const entryResults = await pb.collection('time_entries').getFullList({
filter: `started_at >= "${startDate}" && started_at <= "${endDate}"`,