diff --git a/memento-note/app/actions/admin-settings.ts b/memento-note/app/actions/admin-settings.ts index cdc6501..7fe11f7 100644 --- a/memento-note/app/actions/admin-settings.ts +++ b/memento-note/app/actions/admin-settings.ts @@ -3,7 +3,7 @@ import prisma from '@/lib/prisma' import { auth } from '@/auth' import { sendEmail } from '@/lib/mail' -import { revalidateTag } from 'next/cache' +import { updateTag } from 'next/cache' async function checkAdmin() { const session = await auth() @@ -63,7 +63,7 @@ export async function updateSystemConfig(data: Record) { await prisma.$transaction(operations) // Invalidate cache after update - revalidateTag('system-config') + updateTag('system-config') return { success: true } } catch (error) { diff --git a/memento-note/app/api/ai/tags/route.ts b/memento-note/app/api/ai/tags/route.ts index 49a5ed6..1f681f7 100644 --- a/memento-note/app/api/ai/tags/route.ts +++ b/memento-note/app/api/ai/tags/route.ts @@ -1,7 +1,7 @@ import { NextRequest, NextResponse } from 'next/server'; import { auth } from '@/auth'; import { contextualAutoTagService } from '@/lib/ai/services/contextual-auto-tag.service'; -import { getAIProvider } from '@/lib/ai/factory'; +import { getTagsProvider } from '@/lib/ai/factory'; import { getSystemConfig } from '@/lib/config'; import { z } from 'zod'; @@ -44,7 +44,7 @@ export async function POST(req: NextRequest) { // Otherwise, use legacy auto-tagging (generates new tags) const config = await getSystemConfig(); - const provider = getAIProvider(config); + const provider = getTagsProvider(config); const tags = await provider.generateTags(content, language); return NextResponse.json({ tags }); diff --git a/memento-note/hooks/use-auto-tagging.ts b/memento-note/hooks/use-auto-tagging.ts index f2336a2..5604da6 100644 --- a/memento-note/hooks/use-auto-tagging.ts +++ b/memento-note/hooks/use-auto-tagging.ts @@ -22,13 +22,6 @@ export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoT const previousNotebookId = useRef(notebookId); const analyzeContent = async (contentToAnalyze: string) => { - // CRITICAL: Don't suggest labels in "General Notes" (notebookId is null) - // Labels should ONLY appear within notebooks, not in the general notes section - if (!notebookId) { - setSuggestions([]); - return; - } - if (!contentToAnalyze || contentToAnalyze.length < 10) { setSuggestions([]); return; diff --git a/memento-note/lib/ai/services/auto-label-creation.service.ts b/memento-note/lib/ai/services/auto-label-creation.service.ts index aa61cc8..6862a73 100644 --- a/memento-note/lib/ai/services/auto-label-creation.service.ts +++ b/memento-note/lib/ai/services/auto-label-creation.service.ts @@ -1,5 +1,5 @@ import { prisma } from '@/lib/prisma' -import { getAIProvider } from '@/lib/ai/factory' +import { getTagsProvider } from '@/lib/ai/factory' import { getSystemConfig } from '@/lib/config' export interface SuggestedLabel { @@ -106,7 +106,7 @@ export class AutoLabelCreationService { try { const config = await getSystemConfig() - const provider = getAIProvider(config) + const provider = getTagsProvider(config) const response = await provider.generateText(prompt) // Parse AI response