diff --git a/logs/.988a9e615c70cb8f387540c142c015feefe8a176-audit.json b/logs/.988a9e615c70cb8f387540c142c015feefe8a176-audit.json index f4ebe2658..7fe468904 100644 --- a/logs/.988a9e615c70cb8f387540c142c015feefe8a176-audit.json +++ b/logs/.988a9e615c70cb8f387540c142c015feefe8a176-audit.json @@ -39,6 +39,11 @@ "date": 1761196910913, "name": "/home/g/dev/orangecat/logs/mcp-puppeteer-2025-10-23.log", "hash": "0e8cb6c65204052538851f639238ca76632c18060e877478df6d3a884f905e1e" + }, + { + "date": 1761300139911, + "name": "/home/g/dev/orangecat/logs/mcp-puppeteer-2025-10-24.log", + "hash": "8557a386b3a9b31cc724716e6342db4b2a40264272f5b3722bf2344f11a5116b" } ], "hashType": "sha256" diff --git a/src/app/(authenticated)/dashboard/page.tsx b/src/app/(authenticated)/dashboard/page.tsx index 68841f4bf..ca31c6a34 100644 --- a/src/app/(authenticated)/dashboard/page.tsx +++ b/src/app/(authenticated)/dashboard/page.tsx @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useAuth } from '@/hooks/useAuth'; -import { useCampaignStore } from '@/stores/projectStore'; +import { useProjectStore } from '@/stores/projectStore'; import { useAnalytics } from '@/hooks/useAnalytics'; import Loading from '@/components/Loading'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/Card'; @@ -38,7 +38,7 @@ export default function DashboardPage() { loadProjects, isLoading: projectLoading, getStats, - } = useCampaignStore(); + } = useProjectStore(); const { metrics, isLoading: analyticsLoading } = useAnalytics(); const router = useRouter(); const [localLoading, setLocalLoading] = useState(true); @@ -134,7 +134,7 @@ export default function DashboardPage() { const totalDrafts = drafts.length; // Get featured project (most recent active or highest funded) - const featuredCampaign = + const featuredProject = activeProjects.length > 0 ? activeProjects.sort((a, b) => (b.total_funding || 0) - (a.total_funding || 0))[0] : projects.find(c => c.title?.toLowerCase().includes('orange cat')) || // Specifically look for Orange Cat @@ -181,8 +181,8 @@ export default function DashboardPage() { - {/* Featured Campaign Spotlight */} - {featuredCampaign && ( + {/* Featured Project Spotlight */} + {featuredProject && (
@@ -192,22 +192,22 @@ export default function DashboardPage() {

- 🎯 Your Featured Campaign + 🎯 Your Featured Project

- {featuredCampaign.is_active ? 'Active' : 'Draft'} + {featuredProject.is_active ? 'Active' : 'Draft'}
-

{featuredCampaign.title}

-

{featuredCampaign.description}

+

{featuredProject.title}

+

{featuredProject.description}

Raised

@@ -217,7 +217,7 @@ export default function DashboardPage() {

Goal

@@ -226,16 +226,15 @@ export default function DashboardPage() {

Supporters

- {featuredCampaign.contributor_count || 0} + {featuredProject.contributor_count || 0}

Progress

- {featuredCampaign.goal_amount + {featuredProject.goal_amount ? Math.round( - ((featuredCampaign.total_funding || 0) / - featuredCampaign.goal_amount) * + ((featuredProject.total_funding || 0) / featuredProject.goal_amount) * 100 ) : 0} @@ -245,13 +244,13 @@ export default function DashboardPage() {

- + - +
-

Create Your First Campaign

+

Create Your First Project

🚀 Ready to launch?
Your Bitcoin fundraising page is just a few clicks away
@@ -593,7 +592,7 @@ export default function DashboardPage() {

Activity tracking coming soon

diff --git a/src/app/api/projects/[id]/route.ts b/src/app/api/projects/[id]/route.ts index 8ac531a3a..8e27aefb3 100644 --- a/src/app/api/projects/[id]/route.ts +++ b/src/app/api/projects/[id]/route.ts @@ -84,17 +84,17 @@ export async function PUT(request: NextRequest, { params }: { params: { id: stri const validatedData = projectSchema.parse(body); // Check if user owns the project - const { data: existingCampaign, error: fetchError } = await supabase + const { data: existingProject, error: fetchError } = await supabase .from('projects') - .select('creator_id') + .select('user_id') .eq('id', id) .single(); - if (fetchError || !existingCampaign) { + if (fetchError || !existingProject) { return apiNotFound('Project not found'); } - if (existingCampaign.creator_id !== user.id) { + if (existingProject.user_id !== user.id) { return apiUnauthorized('You can only update your own projects'); }