diff --git a/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java b/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java index a3dc23f6..439918b3 100644 --- a/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java +++ b/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java @@ -2,9 +2,11 @@ package app.module.front.config.application.security; import java.util.Collection; import lombok.Getter; +import lombok.Setter; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; +@Setter @Getter public class FrontHouseholdUser extends User { diff --git a/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java b/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java index 47ce01df..ed76cc5d 100644 --- a/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java +++ b/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java @@ -20,7 +20,7 @@ class GetNoticesUIController { private final GetNoticesPortIn getNoticesPortIn; @GetMapping(path = "/info/notice") - String operate(Model model, @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, page = 0, size = 5) Pageable pageable + String operate(Model model, @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, page = 0, size = 10) Pageable pageable , GetNoticesReqVO reqVO) { reqVO.setSearchOpen("true"); diff --git a/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java b/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java index d5332c63..981795d9 100644 --- a/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java +++ b/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java @@ -3,6 +3,7 @@ package app.module.front.usecase.info.userUI.updateUserUI.adapters.web; import app.module.core.config.application.util.CommonUtil; import app.module.core.config.application.util.CoreUtil; import app.module.front.config.application.response.ApiResponse; +import app.module.front.config.application.security.FrontHouseholdUser; import app.module.front.usecase.info.userFront.getUserFront.ports.GetUserFrontPortIn; import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFront; import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFrontCmd; @@ -14,6 +15,9 @@ import app.module.front.usecase.info.userUI.updateUserUI.adapters.web.model.Upda import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.PostMapping; @@ -45,6 +49,10 @@ class UpdateUserController { getHousehold.getOwnerName(), "PERSONAL" )); + + Authentication currentAuth = SecurityContextHolder.getContext().getAuthentication(); + FrontHouseholdUser householdUser = (FrontHouseholdUser) currentAuth.getPrincipal(); + householdUser.setOwnerName(reqVO.getOwnerName()); } updateUserPortIn.operate(new UpdateUserFrontCmd( getHousehold.getSeq(), diff --git a/front/src/main/resources/static/ui/uiUtil.js b/front/src/main/resources/static/ui/uiUtil.js index 14f766d6..ba2b121d 100644 --- a/front/src/main/resources/static/ui/uiUtil.js +++ b/front/src/main/resources/static/ui/uiUtil.js @@ -6,7 +6,7 @@ */ function goPageable(page, size, orderBy, orderDir) { let uri = new Uri(location.href); - uri.replaceQueryParam('pageNumber', page).replaceQueryParam('pageSize', size) + uri.replaceQueryParam('page', page).replaceQueryParam('pageSize', size) .replaceQueryParam('orderBy', orderBy).replaceQueryParam('orderDir', orderDir); diff --git a/front/src/main/resources/templates/info/notice/notices.html b/front/src/main/resources/templates/info/notice/notices.html index 855484a1..0bf5ee93 100644 --- a/front/src/main/resources/templates/info/notice/notices.html +++ b/front/src/main/resources/templates/info/notice/notices.html @@ -113,15 +113,10 @@ */ goSearch() { const f = document.reqForm; - + f.page.value = 0; f.searchField.value = document.getElementById('searchFieldId').value; f.submit(); }, - goPageable(page, size, sort) { - const f = document.reqForm; - f.page.value = page; - f.submit(); - } } diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index d39c7a0e..4fbc30a2 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -420,13 +420,11 @@ f.tel1.value = ENV.select.selectTel.getValue(); f.phone1.value = ENV.select.selectPhone.getValue(); - const obj = $(f).serializeObject(); ajaxUtil._ajaxAsync( ENV.httpUrl.user, $(f).serializeObject(), function (rstData, status) { if (rstData.code === 'SUCCESS') { - // 유효성 검사를 모두 통과한 후 ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => { location.href = '/info'; });