월별, 임산물 sql에러 수정
This commit is contained in:
@@ -2,126 +2,54 @@
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div layout:fragment="content">
|
||||
<main id="content" role="main">
|
||||
|
||||
<style>
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
background-color: #e9ecef;
|
||||
color: #6c757d;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<form
|
||||
method="get"
|
||||
name="reqForm"
|
||||
th:action="@{/user/info}" th:object="${userInfo}">
|
||||
|
||||
<input type="hidden" name="id" th:value="*{seq}">
|
||||
|
||||
<div>
|
||||
<label for="householdNum">임가번호</label>
|
||||
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerName">경영주</label>
|
||||
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerAge">만나이</label>
|
||||
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tel">가구연락처</label>
|
||||
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="phone">핸드폰번호</label>
|
||||
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<!-- <div>-->
|
||||
<!-- <label for="region">시.도</label>-->
|
||||
<!-- <input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <label for="city">시.군.도</label>-->
|
||||
<!-- <input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<div>
|
||||
<label for="addressDetail">전체 주소</label>
|
||||
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{address}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button onclick="updateUser();">수정하기</button>
|
||||
</div>
|
||||
</main>
|
||||
<div layout:fragment="content" th:classappend="'mypage-wrap'">
|
||||
<main id="content" role="main">
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
월별 등록된 <strong>임산물 현황</strong>을 <br> 확인하세요.
|
||||
</h3>
|
||||
</hgroup>
|
||||
<ul class="product-col-list">
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="list-tit">2025년 5월</p>
|
||||
<span class="tag">미등록</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="complete">
|
||||
<a href="">
|
||||
<p class="list-tit">2025년 5월</p>
|
||||
<span class="tag">등록완료</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="complete">
|
||||
<a href="">
|
||||
<p class="list-tit">2025년 5월</p>
|
||||
<span class="tag">등록완료</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const updateUser = () => {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[#{uri.front.info.notice.path}]]*/'detailUrl',
|
||||
notice: /*[[#{uri.front.info.notice.path}]]*/'noticeUrl'
|
||||
},
|
||||
module:{
|
||||
confirmPopup : null
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
let formControl = {
|
||||
init(){
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '/api/front/household/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
'422': (res) => {
|
||||
const fieldErrors = res.responseJSON.fieldErrors;
|
||||
$(fieldErrors).each(function (idx, error) {
|
||||
let target = $(f).find('[name=' + error.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user