fix(mng): HTMX SPA 네비게이션 오류 수정
## 수정 내용 ### HTMX 응답 형식 수정 - DepartmentController: view 직접 반환 (JSON 래핑 제거) - MenuController: ->render() 제거하여 SVG 이스케이프 문제 해결 ### 사이드바 개선 - hx-boost 적용하여 SPA 스타일 네비게이션 구현 - 메뉴 클릭 시 활성화 상태 즉시 반영 - 스크롤 위치 저장/복원 기능 추가 ### 불필요한 코드 제거 - departments/index.blade.php: JSON.parse 코드 제거 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,20 +18,16 @@ public function __construct(
|
||||
/**
|
||||
* 부서 목록 조회
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
public function index(Request $request): JsonResponse|\Illuminate\View\View
|
||||
{
|
||||
$departments = $this->departmentService->getDepartments(
|
||||
$request->all(),
|
||||
$request->integer('per_page', 10)
|
||||
);
|
||||
|
||||
// HTMX 요청 시 HTML 반환
|
||||
// HTMX 요청 시 HTML 직접 반환
|
||||
if ($request->header('HX-Request')) {
|
||||
$html = view('departments.partials.table', compact('departments'))->render();
|
||||
|
||||
return response()->json([
|
||||
'html' => $html,
|
||||
]);
|
||||
return view('departments.partials.table', compact('departments'));
|
||||
}
|
||||
|
||||
// 일반 요청 시 JSON 반환
|
||||
|
||||
Reference in New Issue
Block a user