fix:HTMX 네비게이션 리다이렉트 처리 개선
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
use App\Models\Admin\AdminPmTask;
|
||||
use App\Services\ProjectManagement\DailyLogService;
|
||||
use App\Services\ProjectManagement\ProjectService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class DailyLogController extends Controller
|
||||
@@ -19,8 +21,13 @@ public function __construct(
|
||||
/**
|
||||
* 일일 로그 목록 화면
|
||||
*/
|
||||
public function index(): View
|
||||
public function index(Request $request): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드 (스크립트 로딩을 위해)
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('daily-logs.index'));
|
||||
}
|
||||
|
||||
$tenantId = session('current_tenant_id', 1);
|
||||
|
||||
$projects = $this->projectService->getActiveProjects();
|
||||
@@ -133,8 +140,13 @@ private function getAttentionTasks(): array
|
||||
/**
|
||||
* 일일 로그 상세 화면
|
||||
*/
|
||||
public function show(int $id): View
|
||||
public function show(Request $request, int $id): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('daily-logs.show', $id));
|
||||
}
|
||||
|
||||
$tenantId = session('current_tenant_id', 1);
|
||||
|
||||
$log = $this->dailyLogService->getDailyLogById($id, true);
|
||||
@@ -160,8 +172,13 @@ public function show(int $id): View
|
||||
/**
|
||||
* 오늘 날짜 로그 화면 (자동 생성)
|
||||
*/
|
||||
public function today(): View
|
||||
public function today(Request $request): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('daily-logs.today'));
|
||||
}
|
||||
|
||||
$tenantId = session('current_tenant_id', 1);
|
||||
$today = now()->format('Y-m-d');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user