Verify provider failure preserves drafts and improve user feedback
This commit is contained in:
+2
-2
@@ -1306,7 +1306,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (!aiConfigured()) {
|
||||
return json(res, 503, {
|
||||
success: false,
|
||||
error: 'AI yapılandırılmamış — sunucuya en az bir sağlayıcı anahtarı ekleyin (ZAI_API_KEY / DEEPSEEK_API_KEY / GEMINI_API_KEY …)',
|
||||
error: 'AI hizmeti şu anda kullanılamıyor. Daha sonra yeniden deneyin; sorun sürerse uygulama yöneticinize bildirin.',
|
||||
});
|
||||
}
|
||||
try {
|
||||
@@ -1456,7 +1456,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if ((url.pathname === '/api/ai/belge-sor' || url.pathname === '/api/ai/teklif-denetim' || url.pathname === '/api/ai/teklif-taslak') && req.method === 'POST') {
|
||||
const user = userFromAuthHeader(req.headers['authorization']);
|
||||
if (!user) return json(res, 401, { success: false, error: 'oturum yok' });
|
||||
if (!aiConfigured()) return json(res, 503, { success: false, error: 'AI yapılandırılmamış — sunucuya bir sağlayıcı anahtarı ekleyin.' });
|
||||
if (!aiConfigured()) return json(res, 503, { success: false, error: 'AI hizmeti şu anda kullanılamıyor. Daha sonra yeniden deneyin; sorun sürerse uygulama yöneticinize bildirin.' });
|
||||
try {
|
||||
const body = await readBody(req, 2 * 1024 * 1024);
|
||||
const ortak = { ikn: body.ikn, tender: body.tender, chain: body.chain, text: body.text };
|
||||
|
||||
Reference in New Issue
Block a user