@adyen/kyc-components 2.34.1 → 2.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31662,6 +31662,31 @@ function TrustDropinComponent({
|
|
|
31662
31662
|
const requiredForms = getRequiredForms(trustForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
31663
31663
|
return addValidityToForms(requiredForms, formValidity, problems);
|
|
31664
31664
|
}, [derivedProps, formValidity, problems]);
|
|
31665
|
+
useEffect(() => {
|
|
31666
|
+
var _a2;
|
|
31667
|
+
const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
|
|
31668
|
+
try {
|
|
31669
|
+
if (documentIds.length) {
|
|
31670
|
+
documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
|
|
31671
|
+
const mappedDocuments = mapApiDocumentToTrustDocument(legalEntityResponse.id);
|
|
31672
|
+
setData({
|
|
31673
|
+
...data,
|
|
31674
|
+
...mappedDocuments
|
|
31675
|
+
});
|
|
31676
|
+
}).catch(() => {
|
|
31677
|
+
showToast({
|
|
31678
|
+
label: i18n.get("failedToFetchRelevantDocuments"),
|
|
31679
|
+
type: ToastType.ERROR
|
|
31680
|
+
});
|
|
31681
|
+
});
|
|
31682
|
+
}
|
|
31683
|
+
} catch (e) {
|
|
31684
|
+
showToast({
|
|
31685
|
+
label: i18n.get("failedToFetchRelevantDocuments"),
|
|
31686
|
+
type: ToastType.ERROR
|
|
31687
|
+
});
|
|
31688
|
+
}
|
|
31689
|
+
}, []);
|
|
31665
31690
|
const onSubmit = async () => {
|
|
31666
31691
|
setLoadingStatus("loading");
|
|
31667
31692
|
const trustDetails2 = mapTrustToLegalEntity(data);
|