- API 선택 검증 로직 수정 - 선택 사항으로 변경

- '인증 키 관리' → '앱 관리' 용어 변경
- API 미선택 시 확인 팝업 로직 추가
This commit is contained in:
Rinjae
2026-07-27 18:20:37 +09:00
parent 41be827b81
commit 61be6bf108
8 changed files with 38 additions and 21 deletions
+28 -4
View File
@@ -447,18 +447,42 @@ document.addEventListener('DOMContentLoaded', function() {
});
}
// Form validation
// Form submit
// - Webhook/앱 변경은 API 가 필수(form data-api-required=true)이므로 미선택 시 차단한다.
// - 앱 신청(myapikey register)은 선택 사항이라, 미선택 시 확인 팝업으로 한 번 더 묻고 진행한다.
form.addEventListener('submit', function(e) {
if (selectedApis.size === 0) {
if (selectedApis.size !== 0) {
syncHiddenSelected();
return;
}
var apiRequired = form.dataset.apiRequired === 'true';
if (apiRequired) {
e.preventDefault();
if (window.customPopups && customPopups.showAlert) {
if (typeof customPopups !== 'undefined' && customPopups.showAlert) {
customPopups.showAlert('최소 1개 이상의 API를 선택해주세요.');
} else {
alert('최소 1개 이상의 API를 선택해주세요.');
}
return false;
}
syncHiddenSelected();
// 미선택 상태로 앱 신청 → 확인 후 진행
e.preventDefault();
var message = '선택한 API가 없습니다. API 없이 앱을 신청하시겠습니까?';
// custom-popups.js 는 top-level const 라 window.customPopups 가 아닌 렉시컬 전역이다.
if (typeof customPopups !== 'undefined' && customPopups.showConfirm) {
customPopups.showConfirm(message, function (ok) {
if (ok) {
syncHiddenSelected();
form.submit(); // submit() 은 submit 이벤트를 재발생시키지 않음 → 재확인 루프 없음
}
});
} else if (window.confirm(message)) {
syncHiddenSelected();
form.submit();
}
return false;
});
// Initialize