feat(mng): 아카이브 레코드 batch 그룹핑 UI 구현
- ArchivedRecordService: batch_id 기준 그룹핑 쿼리 추가 - Controller: batchId 파라미터로 상세 조회 변경 - 목록: 작업 설명, 레코드 타입, 레코드 수 표시 - 상세: batch 내 모든 레코드를 카드 형태로 표시 - 한번의 삭제 작업이 하나의 행으로 표시됨
This commit is contained in:
@@ -14,11 +14,11 @@ public function __construct(
|
||||
) {}
|
||||
|
||||
/**
|
||||
* 아카이브 레코드 목록 조회
|
||||
* 아카이브 레코드 목록 조회 (batch 그룹핑)
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$records = $this->archivedRecordService->getArchivedRecords(
|
||||
$records = $this->archivedRecordService->getArchivedRecordsBatched(
|
||||
$request->all(),
|
||||
$request->integer('per_page', 15)
|
||||
);
|
||||
@@ -46,13 +46,13 @@ public function index(Request $request): JsonResponse
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 아카이브 레코드 조회
|
||||
* 특정 batch의 레코드 조회
|
||||
*/
|
||||
public function show(Request $request, int $id): JsonResponse
|
||||
public function show(Request $request, string $batchId): JsonResponse
|
||||
{
|
||||
$record = $this->archivedRecordService->getArchivedRecordById($id);
|
||||
$records = $this->archivedRecordService->getRecordsByBatchId($batchId);
|
||||
|
||||
if (! $record) {
|
||||
if ($records->isEmpty()) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '아카이브 레코드를 찾을 수 없습니다.',
|
||||
@@ -62,13 +62,13 @@ public function show(Request $request, int $id): JsonResponse
|
||||
// HTMX 요청 시 HTML 반환
|
||||
if ($request->header('HX-Request')) {
|
||||
return response()->json([
|
||||
'html' => view('archived-records.partials.detail', compact('record'))->render(),
|
||||
'html' => view('archived-records.partials.detail', compact('records'))->render(),
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'data' => $record,
|
||||
'data' => $records,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user