fix: respect brief opt-out and report channel delivery failures

This commit is contained in:
2026-09-06 14:28:10 +03:00
parent c55257cade
commit 23512b7a87
5 changed files with 143 additions and 24 deletions
+2 -2
View File
@@ -1537,8 +1537,8 @@ const server = http.createServer(async (req, res) => {
if (url.pathname === '/api/admin/brief/gonder' && req.method === 'POST') {
const user = userFromAuthHeader(req.headers['authorization']);
if (!user?.isAdmin) return json(res, 403, { success: false, error: 'yetki yok' });
const r = await haftalikBriefGonder(async () => (await tendersPayload()).tenders, { zorla: url.searchParams.get('zorla') === '1' });
return json(res, 200, { success: true, ...r });
const r = await haftalikBriefGonder(async () => (await tendersPayload()).tenders);
return json(res, 200, { success: r.hata === 0, partial: r.hata > 0 && r.gonderilen > 0, ...r });
}
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']);