fix: bayat dev-mock raporlar tek kapıdan (kullanicininRaporu) ayıklanıyor
All checks were successful
Deploy / deploy (push) Successful in 9m25s
All checks were successful
Deploy / deploy (push) Successful in 9m25s
Dev'de API anahtarı yokken üretilen mock rapor DB'ye kaydediliyordu; anahtar sonradan eklenince kullanıcı başına tek rapor kuralı yüzünden o bayat mock gerçek AI çıktısıymış gibi servis edilmeye devam ediyordu. Rapor tablosunu okuyan her yer (sonuc/listem/yazdir/odeme-sonuc sayfaları, liste action'ları, soru API'si, dev panel) artık src/lib/rapor-kaydi.ts içindeki kullanicininRaporu() kapısından geçiyor: gerçek AI aktifken mock üretimi kayıt "yok" sayılır, kullanıcı gerçek listeyi yeniden üretir. Yeni mock kayıtlar devMock işareti taşır; eskiler metin ön ekinden tanınır. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
krediBittiIsaretle,
|
||||
} from "@/lib/credits";
|
||||
import { anahtarVar, SORUMLULUK_REDDI } from "@/lib/ai/client";
|
||||
import { kullanicininRaporu } from "@/lib/rapor-kaydi";
|
||||
import { sohbetAkisi } from "@/lib/ai/cagri";
|
||||
import { listeOzetiCikar, type RaporSonuc } from "@/lib/ai/rapor";
|
||||
import type { RaporParams } from "@/lib/rapor-havuzu";
|
||||
@@ -122,10 +123,8 @@ export async function POST(request: NextRequest) {
|
||||
return Response.json({ error: "Geçersiz mesaj." }, { status: 400 });
|
||||
}
|
||||
|
||||
// Soru sormak için önce liste oluşturulmuş olmalı
|
||||
const rapor = await appDb.query.reports.findFirst({
|
||||
where: eq(schema.reports.userId, session.user.id),
|
||||
});
|
||||
// Soru sormak için önce liste oluşturulmuş olmalı (bayat dev mock sayılmaz)
|
||||
const rapor = await kullanicininRaporu(session.user.id);
|
||||
if (!rapor?.result) {
|
||||
return Response.json(
|
||||
{ error: "Önce listeni oluşturmalısın.", code: "NO_REPORT" },
|
||||
|
||||
Reference in New Issue
Block a user