Fix router path - change /documents/ to /document/ in HomeView

Fixed incorrect router navigation causing "No match found" error when
clicking on documents from the home page.

Issue:
- HomeView was navigating to /documents/{id} (plural)
- Router configured as /document/:id (singular)
- Result: Vue Router warning and blank page

Fix:
- Updated both document click handlers in HomeView.vue
- Changed @click routes from /documents/ to /document/
- Lines 230 and 256

Testing:
Clicking documents from home page now correctly navigates to DocumentView
at http://172.29.75.55:8083

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ggq-admin 2025-10-20 01:43:15 +02:00
parent 5f6a7db3c2
commit 4eeb927316
2 changed files with 19 additions and 2 deletions

View file

@ -227,7 +227,7 @@
<div class="space-y-3">
<div v-for="doc in documentsByStatus.processing" :key="doc.id"
class="bg-white/10 backdrop-blur-lg rounded-lg p-4 hover:bg-white/15 transition-all cursor-pointer border border-white/10"
@click="$router.push(`/documents/${doc.id}`)">
@click="$router.push(`/document/${doc.id}`)">
<div class="flex items-center justify-between">
<div class="flex-1">
<h5 class="font-semibold text-white">{{ doc.title }}</h5>
@ -253,7 +253,7 @@
<div class="space-y-3">
<div v-for="doc in documentsByStatus.indexed" :key="doc.id"
class="bg-white/10 backdrop-blur-lg rounded-lg p-4 hover:bg-white/15 transition-all cursor-pointer border border-white/10"
@click="$router.push(`/documents/${doc.id}`)">
@click="$router.push(`/document/${doc.id}`)">
<div class="flex items-center justify-between">
<div class="flex-1">
<h5 class="font-semibold text-white">{{ doc.title }}</h5>

17
server/check-documents.js Normal file
View file

@ -0,0 +1,17 @@
import { getDb } from './db/db.js';
const db = getDb();
const docs = db.prepare(`
SELECT id, title, created_at
FROM documents
ORDER BY created_at DESC
`).all();
console.log(`\nTotal documents in database: ${docs.length}\n`);
docs.forEach((doc, i) => {
console.log(`${i + 1}. ${doc.title}`);
console.log(` ID: ${doc.id}`);
console.log(` Created: ${new Date(doc.created_at).toISOString()}\n`);
});