fix: reject unconfirmed Telegram tests and invalid update responses

This commit is contained in:
2026-09-06 14:55:05 +03:00
parent 37fb7b0366
commit 120657758c
8 changed files with 57 additions and 6 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ const TelegramPanel = ({isAdmin}) => {
</div>
) : d.bagli ? (
<div className="flex flex-wrap gap-2">
<button onClick={() => calistir('test', telegramTest, 'Test mesajı gönderildi — Telegram\'ı kontrol edin.')} disabled={!!busy}
<button onClick={() => calistir('test', telegramTest, 'Telegram sağlayıcısı test mesajını kabul etti. Sohbetinizde kontrol edin.')} disabled={!!busy}
className="bg-sky-600 hover:bg-sky-500 disabled:opacity-40 text-white font-bold text-xs px-4 py-2 rounded-lg flex items-center gap-1.5">
{busy === 'test' ? <Loader2 className="w-3.5 h-3.5 animate-spin" /> : <Send className="w-3.5 h-3.5" />} Test mesajı gönder
</button>
+5 -1
View File
@@ -113,7 +113,11 @@ export const updateDocumentMeta = (id, { sonKullanma, kategori } = {}) =>
export const telegramDurum = () => iste('/api/me/telegram');
export const telegramKodOlustur = () => iste('/api/me/telegram', {method:'POST',body:JSON.stringify({islem:'kod'})});
export const telegramBagla = (kod) => iste('/api/me/telegram', { method: 'POST', body: JSON.stringify({ kod }) });
export const telegramTest = () => iste('/api/me/telegram', { method: 'POST', body: JSON.stringify({ islem: 'test' }) });
export const telegramTest = async () => {
const data=await iste('/api/me/telegram',{method:'POST',body:JSON.stringify({islem:'test'})});
if(typeof data.id!=='string'||!data.id.trim())throw new Error('Telegram gönderim kabulü doğrulanamadı. Tekrar göndermeden önce sohbetinizi kontrol edin.');
return data;
};
export const telegramSil = () => iste('/api/me/telegram', { method: 'DELETE' });
// --- Takip bildirimleri (zeyilname / sonuç) ---