fix(board,menu): 테넌트 게시판 수정 및 메뉴 페이지네이션 오류 수정
테넌트 게시판 수정 404 오류: - BoardService.getBoardById()에 $systemOnly 파라미터 추가 - BoardController.edit()에서 systemOnly=false로 테넌트 게시판 조회 가능 - Api/Admin/BoardController에서 show/update 메서드 테넌트 게시판 지원 - updateAnyBoard() 메서드 사용하여 시스템/테넌트 게시판 공통 수정 메뉴 페이지네이션 쿠키 값 미적용 오류: - HTMX 요청 시 htmx:configRequest 이벤트로 쿠키 값 적용 - pagination_per_page 쿠키에서 per_page 값 읽어서 요청 파라미터에 설정 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,8 @@ public function stats(): JsonResponse
|
||||
*/
|
||||
public function show(int $id): JsonResponse
|
||||
{
|
||||
$board = $this->boardService->getBoardById($id, true);
|
||||
// systemOnly=false: 테넌트 게시판도 조회 가능
|
||||
$board = $this->boardService->getBoardById($id, true, false);
|
||||
|
||||
if (! $board) {
|
||||
return response()->json([
|
||||
@@ -109,7 +110,7 @@ public function store(Request $request): JsonResponse
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 수정
|
||||
* 게시판 수정 (시스템/테넌트 공통)
|
||||
*/
|
||||
public function update(Request $request, int $id): JsonResponse
|
||||
{
|
||||
@@ -126,15 +127,35 @@ public function update(Request $request, int $id): JsonResponse
|
||||
'is_active' => 'nullable|boolean',
|
||||
]);
|
||||
|
||||
// 코드 중복 체크 (자신 제외)
|
||||
if ($this->boardService->isCodeExists($validated['board_code'], $id)) {
|
||||
// 기존 게시판 조회 (systemOnly=false)
|
||||
$board = $this->boardService->getBoardById($id, true, false);
|
||||
|
||||
if (! $board) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '이미 사용 중인 게시판 코드입니다.',
|
||||
], 422);
|
||||
'message' => '게시판을 찾을 수 없습니다.',
|
||||
], 404);
|
||||
}
|
||||
|
||||
$this->boardService->updateBoard($id, $validated);
|
||||
// 코드 중복 체크 (자신 제외, 시스템/테넌트 구분)
|
||||
if ($board->is_system) {
|
||||
if ($this->boardService->isCodeExists($validated['board_code'], $id)) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '이미 사용 중인 게시판 코드입니다.',
|
||||
], 422);
|
||||
}
|
||||
} else {
|
||||
if ($this->boardService->isTenantCodeExists($validated['board_code'], $board->tenant_id, $id)) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '해당 테넌트에서 이미 사용 중인 게시판 코드입니다.',
|
||||
], 422);
|
||||
}
|
||||
}
|
||||
|
||||
// 시스템/테넌트 공통 수정 메서드 사용
|
||||
$this->boardService->updateAnyBoard($id, $validated);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
|
||||
Reference in New Issue
Block a user