diff --git a/client/src/App.tsx b/client/src/App.tsx index 425281c..f600756 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -8,7 +8,7 @@ import { ThemeProvider } from "@/context/ThemeContext"; import LandingPage from "@/pages/LandingPage"; import DashboardPage from "@/pages/DashboardPage"; import LoginPage from "@/pages/LoginPage"; -import OnboardingPage from "@/pages/OnboardingPage"; +// import OnboardingPage from "@/pages/OnboardingPage"; import NotFound from "@/pages/not-found"; function Router() { @@ -16,7 +16,7 @@ function Router() { - + {/* */} diff --git a/client/src/pages/LandingPage.tsx b/client/src/pages/LandingPage.tsx index e54a9e0..accf71a 100644 --- a/client/src/pages/LandingPage.tsx +++ b/client/src/pages/LandingPage.tsx @@ -54,7 +54,7 @@ export default function LandingPage() { {/* Hero Section */}
{/* Background Pattern */} -
+
diff --git a/server/storage.ts b/server/storage.ts index a441c7b..7a91530 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -104,10 +104,10 @@ export class DatabaseStorage implements IStorage { } async getTasks(userId: number, status?: string): Promise { - const query = db.select().from(tasks).where(eq(tasks.userId, userId)); + let query = db.select().from(tasks).where(eq(tasks.userId, userId)); if (status) { - query.where(and(eq(tasks.userId, userId), eq(tasks.status, status))); + query = db.select().from(tasks).where(and(eq(tasks.userId, userId), eq(tasks.status, status))); } return await query.orderBy(desc(tasks.createdAt)); @@ -134,7 +134,7 @@ export class DatabaseStorage implements IStorage { const result = await db .delete(tasks) .where(and(eq(tasks.id, id), eq(tasks.userId, userId))); - return result.rowCount > 0; + return (result.rowCount || 0) > 0; } async createFinancialRecord(record: InsertFinancialRecord): Promise { @@ -146,37 +146,31 @@ export class DatabaseStorage implements IStorage { } async getFinancialRecords(userId: number, startDate?: Date, endDate?: Date): Promise { - let query = db.select().from(financialRecords).where(eq(financialRecords.userId, userId)); + let whereConditions = [eq(financialRecords.userId, userId)]; if (startDate && endDate) { - query = query.where( - and( - eq(financialRecords.userId, userId), - gte(financialRecords.date, startDate), - lte(financialRecords.date, endDate) - ) - ); + whereConditions.push(gte(financialRecords.date, startDate)); + whereConditions.push(lte(financialRecords.date, endDate)); } + const query = db.select().from(financialRecords).where(and(...whereConditions)); + return await query.orderBy(desc(financialRecords.date)); } async getFinancialSummary(userId: number, startDate?: Date, endDate?: Date): Promise<{ income: number; expenses: number; net: number }> { - let query = db.select({ - type: financialRecords.type, - amount: financialRecords.amount - }).from(financialRecords).where(eq(financialRecords.userId, userId)); + let whereConditions = [eq(financialRecords.userId, userId)]; if (startDate && endDate) { - query = query.where( - and( - eq(financialRecords.userId, userId), - gte(financialRecords.date, startDate), - lte(financialRecords.date, endDate) - ) - ); + whereConditions.push(gte(financialRecords.date, startDate)); + whereConditions.push(lte(financialRecords.date, endDate)); } + const query = db.select({ + type: financialRecords.type, + amount: financialRecords.amount + }).from(financialRecords).where(and(...whereConditions)); + const records = await query; let income = 0; @@ -211,7 +205,7 @@ export class DatabaseStorage implements IStorage { const result = await db .delete(financialRecords) .where(and(eq(financialRecords.id, id), eq(financialRecords.userId, userId))); - return result.rowCount > 0; + return (result.rowCount || 0) > 0; } async createVoiceCommand(command: InsertVoiceCommand): Promise {