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:
@@ -7,6 +7,7 @@
|
||||
import { eq } from "drizzle-orm";
|
||||
import { headers } from "next/headers";
|
||||
import { appDb, schema } from "@/lib/appdb";
|
||||
import { kullanicininRaporu } from "@/lib/rapor-kaydi";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { getCurrentUser } from "@/lib/session";
|
||||
import { URUNLER } from "@/lib/credits";
|
||||
@@ -33,10 +34,7 @@ export async function devDurum(): Promise<DevDurum> {
|
||||
devKontrol();
|
||||
const user = await getCurrentUser();
|
||||
if (!user) return { girisli: false };
|
||||
const rapor = await appDb.query.reports.findFirst({
|
||||
where: eq(schema.reports.userId, user.id),
|
||||
columns: { params: true },
|
||||
});
|
||||
const rapor = await kullanicininRaporu(user.id);
|
||||
const params = rapor?.params as { sira?: number; tur?: string } | undefined;
|
||||
return {
|
||||
girisli: true,
|
||||
|
||||
Reference in New Issue
Block a user