validate delivery message text fields

This commit is contained in:
2026-09-06 17:25:46 +03:00
parent 1afe871cfa
commit ba33531a12
+1 -1
View File
@@ -13,7 +13,7 @@ function Queue({weekly}){
const load=async()=>{
const data=await accountRequest(endpoint);
const received=requireArray(data,'deliveries');
const rows=received.filter(row=>row && typeof row==='object' && typeof row.id==='string' && row.id.trim() && typeof row.state==='string');
const rows=received.filter(row=>row && typeof row==='object' && typeof row.id==='string' && row.id.trim() && typeof row.state==='string' && (row.subject == null || typeof row.subject==='string') && (row.to == null || ['string','number'].includes(typeof row.to)) && (row.error == null || typeof row.error==='string'));
if(rows.length!==received.length)throw new Error('Sunucu gönderim kayıtlarından birini geçersiz döndürdü. Liste yenilenemedi.');
if(alive.current)setRows(rows);
};