261028_02_ENH: 새로운 카트 연결하면서 구버전 kfunc 관련 오류 잡음

This commit is contained in:
2026-10-28 14:48:53 +09:00
parent 998d04d39c
commit d94c8b14ab
3 changed files with 54 additions and 30 deletions

View File

@@ -134,16 +134,25 @@ kon.survey = (function () {
})
}
function submitNextPage(form, waits) {
function submitNextPage(form, waits) {
// undefined 또는 잘못된 Promise 제거
waits = waits.filter(function (wait) {
return wait && typeof wait.always === "function";
});
var remaining = waits.length;
if (remaining === 0) {
form.attr("onsubmit", "");
form.submit();
return;
}
waits.forEach(function (wait) {
wait.always(function () {
remaining--;
if (remaining === 0) {
form.attr("onsubmit", "");
form.submit();
@@ -192,38 +201,43 @@ kon.survey = (function () {
}
function callKartDerived(pkey, idkey) {
var url = KART_BASE_URL
+ "/project/" + KART_PROJECT_TYPE
+ "/" + encodeURIComponent(pkey)
+ "/derived/respondent/" + encodeURIComponent(idkey)
+ "/recalculate";
try{
var url = KART_BASE_URL
+ "/project/" + KART_PROJECT_TYPE
+ "/" + encodeURIComponent(pkey)
+ "/derived/respondent/" + encodeURIComponent(idkey)
+ "/recalculate";
logExternalApi("DERIVED", idkey, "", "REQUEST", "");
logExternalApi("DERIVED", idkey, "", "REQUEST", "");
return $.ajax({
url: url,
type: "POST",
headers: {
"X-API-Key": KON_KIWI_API_KEY
},
dataType: "json",
cache: false,
timeout: 60000,
return $.ajax({
url: url,
type: "POST",
headers: {
"X-API-Key": KON_KIWI_API_KEY
},
dataType: "json",
cache: false,
timeout: 60000,
success: function (data, status, xhr) {
logExternalApi(
"DERIVED", idkey, "", "SUCCESS",
"HTTP " + xhr.status
);
},
success: function (data, status, xhr) {
logExternalApi(
"DERIVED", idkey, "", "SUCCESS",
"HTTP " + xhr.status
);
},
error: function (xhr, status) {
logExternalApi(
"DERIVED", idkey, "", "FAIL",
"HTTP " + xhr.status + " / " + status
);
}
});
error: function (xhr, status) {
logExternalApi(
"DERIVED", idkey, "", "FAIL",
"HTTP " + xhr.status + " / " + status
);
}
});
}
catch(ex){
return $.Deferred().resolve().promise();
}
}
function callContactStatusApi(contactMappingList, idkey, statuses) {