From 60efe78bdc1f232fc5f09d37a7344819744f863c Mon Sep 17 00:00:00 2001 From: kanghana1 Date: Sun, 27 Sep 2026 17:21:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=88=98=EA=B0=95=EC=8B=A0=EC=B2=AD=20?= =?UTF-8?q?=ED=99=95=EC=A0=95=20=EB=8B=A8=EA=B3=84=20=EB=88=84=EB=9D=BD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 대기열 순번(WAITING)까지는 동작하나, 내 차례(ALLOWED)에서 프론트가 해당 상태를 처리하지 않아 '실패' alert가 뜨고 실제 신청이 완료되지 않던 문제. - pollStatus에 ALLOWED 분기 추가 -> POST /courses/apply/confirm 호출 - confirm 성공 시 완료 alert 후 새로고침 --- .../resources/templates/courses/register-form.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/resources/templates/courses/register-form.html b/src/main/resources/templates/courses/register-form.html index 9e794ff..97823e0 100644 --- a/src/main/resources/templates/courses/register-form.html +++ b/src/main/resources/templates/courses/register-form.html @@ -304,6 +304,20 @@

⏳ 수강신청 대기 중

} else { countElem.innerText = "집계 중..."; } + } else if (data.status === 'ALLOWED') { + // 내 차례 도착 -> 최종 확정 요청(POST /courses/apply/confirm) + clearInterval(pollingInterval); + fetch('/courses/apply/confirm?code=' + code, { method: 'POST' }) + .then(res => res.json()) + .then(result => { + alert(result.message); + closeModal(); + location.reload(); + }) + .catch(err => { + console.error("확정 에러:", err); + alert("수강신청 확정 중 오류가 발생했습니다."); + }); } else if (data.status === 'SUCCESS') { clearInterval(pollingInterval); alert(data.message);