- enabled creation of appl for the same user/company after one being rejected;

This commit is contained in:
Vitalii Kiiko
2025-02-12 12:33:49 +01:00
parent 2656c9ba3e
commit 2afd7a2362

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect, useRef } from 'react';
import { __ } from '@wordpress/i18n';
import { useNavigate, useParams } from 'react-router-dom';
import { is, isEmpty, isNil } from 'ramda';
import { head, is, isEmpty, isNil } from 'ramda';
import 'quill/dist/quill.core.css';
// store
@@ -244,7 +244,10 @@ const BandoViewBeneficiario = () => {
const getApplCallback = (data) => {
if (data.status === 'SUCCESS') {
if (data.data.length) {
setApplicationObj(data.data[0]);
const nonRejectedAppl = head(data.data.filter(o => !['REJECTED'].includes(o.status)));
if (nonRejectedAppl) {
setApplicationObj(nonRejectedAppl);
}
}
}
storeSet.main.unsetAsyncRequest();