|
|
|
@@ -20,7 +20,7 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor |
|
|
|
import { |
|
|
|
// isORGLoggedIn, |
|
|
|
isDummyLoggedIn, |
|
|
|
// checkIsOnlyOnlinePaymentByIssueDate |
|
|
|
checkIsOnlyOnlinePaymentByIssueDate |
|
|
|
// isCreditorLoggedIn |
|
|
|
} from "utils/Utils"; |
|
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
|
@@ -57,14 +57,47 @@ const ApplyForm = () => { |
|
|
|
response["faxNumber"] = ""; |
|
|
|
} |
|
|
|
|
|
|
|
var selection = []; |
|
|
|
for (var i = 0; i < response?.gazetteIssueList?.length; i++) { |
|
|
|
let data = response.gazetteIssueList[i]; |
|
|
|
//let label = getIssueLabel(data); |
|
|
|
selection.push(<FormControlLabel value={data.id} control={<Radio />} label={getIssueLabel(data)} />); |
|
|
|
if (response?.gazetteIssueList) { |
|
|
|
const issueList = response.gazetteIssueList; |
|
|
|
|
|
|
|
// check each issue |
|
|
|
const allTrue = issueList.every((d) => |
|
|
|
checkIsOnlyOnlinePaymentByIssueDate(d.issueDate) |
|
|
|
); |
|
|
|
|
|
|
|
if (allTrue){ |
|
|
|
// either way, always render all issues |
|
|
|
const selection = issueList.map((data) => ( |
|
|
|
<FormControlLabel |
|
|
|
key={data.id} |
|
|
|
value={data.id} |
|
|
|
control={<Radio />} |
|
|
|
label={getIssueLabel(data)} |
|
|
|
/> |
|
|
|
)); |
|
|
|
|
|
|
|
setGazetteIssueList(issueList); |
|
|
|
setSelection(selection); |
|
|
|
} else { |
|
|
|
let selection = []; |
|
|
|
for (let i = 0; i < response.gazetteIssueList.length; i++) { |
|
|
|
let data = response.gazetteIssueList[i]; |
|
|
|
// only add if false |
|
|
|
if (!checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) { |
|
|
|
selection.push( |
|
|
|
<FormControlLabel |
|
|
|
key={data.id} |
|
|
|
value={data.id} |
|
|
|
control={<Radio />} |
|
|
|
label={getIssueLabel(data)} |
|
|
|
/> |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
setGazetteIssueList(issueList); |
|
|
|
setSelection(selection); |
|
|
|
} |
|
|
|
} |
|
|
|
setGazetteIssueList(response?.gazetteIssueList); |
|
|
|
setSelection(selection); |
|
|
|
setUserData(response); |
|
|
|
// setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) |
|
|
|
} |
|
|
|
|