- added filter for displaying bando documents;

This commit is contained in:
Vitalii Kiiko
2024-10-24 09:55:56 +02:00
parent 4a2a9b5eed
commit 7e24a7eee9
3 changed files with 14 additions and 6 deletions

View File

@@ -141,6 +141,10 @@ const BandoEdit = () => {
detail: __('Pubblicato!', 'gepafin') detail: __('Pubblicato!', 'gepafin')
}); });
} }
if (data.data.docs) {
data.data.docs = data.data.docs
.filter(o => o.source === 'CALL' && o.type === 'DOCUMENT');
}
setData(data.data); setData(data.data);
} }
storeSet.main.unsetAsyncRequest(); storeSet.main.unsetAsyncRequest();
@@ -179,7 +183,10 @@ const BandoEdit = () => {
]); ]);
} }
} }
if (data.data.docs) {
data.data.docs = data.data.docs
.filter(o => o.source === 'CALL' && o.type === 'DOCUMENT');
}
setData(data.data); setData(data.data);
} }
storeSet.main.unsetAsyncRequest(); storeSet.main.unsetAsyncRequest();
@@ -236,7 +243,8 @@ const BandoEdit = () => {
} }
} else { } else {
BandoService.getBando(id, getCallback, errGetCallback); BandoService.getBando(id, getCallback, errGetCallback);
FormsService.getFormsForCall(id, getFormsCallback, () => {}); FormsService.getFormsForCall(id, getFormsCallback, () => {
});
} }
}, [id]); }, [id]);

View File

@@ -177,7 +177,7 @@ const BandoView = () => {
<div className="row rowContent"> <div className="row rowContent">
<ul> <ul>
{data.docs {data.docs
.filter(o => o.source === 'CALL') .filter(o => o.source === 'CALL' && o.type === 'DOCUMENT')
.map((o, i) => <li key={i}> .map((o, i) => <li key={i}>
<a href={o.filePath} target="_blank" rel="noreferrer">{o.name}</a> <a href={o.filePath} target="_blank" rel="noreferrer">{o.name}</a>
</li>)} </li>)}

View File

@@ -328,7 +328,7 @@ const BandoViewBeneficiario = () => {
<div className="row rowContent"> <div className="row rowContent">
<ul> <ul>
{data.docs {data.docs
.filter(o => o.source === 'CALL') .filter(o => o.source === 'CALL' && o.type === 'DOCUMENT')
.map((o, i) => <li key={i}> .map((o, i) => <li key={i}>
<a href={o.filePath} target="_blank" rel="noreferrer">{o.name}</a> <a href={o.filePath} target="_blank" rel="noreferrer">{o.name}</a>
</li>)} </li>)}