validate delivery message text fields
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user