feat: fetchWrapper 마이그레이션 및 토큰 리프레시 캐싱 구현

- 40+ actions.ts 파일을 fetchWrapper 패턴으로 마이그레이션
- 토큰 리프레시 캐싱 로직 추가 (refresh-token.ts)
- ApiErrorContext 추가로 전역 에러 처리 개선
- HR EmployeeForm 컴포넌트 개선
- 참조함(ReferenceBox) 기능 수정
- juil 테스트 URL 페이지 추가
- claudedocs 문서 업데이트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
byeongcheolryu
2025-12-30 17:00:18 +09:00
parent 0e5307f7a3
commit d38b1242d7
82 changed files with 7434 additions and 4775 deletions

View File

@@ -29,6 +29,7 @@ import {
import { Search, Plus, Edit, Trash2, Package, Loader2 } from 'lucide-react';
import { TableLoadingSpinner } from '@/components/ui/loading-spinner';
import { useItemList } from '@/hooks/useItemList';
import { handleApiError } from '@/lib/api/error-handler';
import {
IntegratedListTemplateV2,
type TabOption,
@@ -183,10 +184,15 @@ export default function ItemListClient() {
},
});
// 🚨 401 인증 에러 시 자동 로그인 페이지 리다이렉트
if (!response.ok) {
await handleApiError(response);
}
const result = await response.json();
console.log('[Delete] 응답:', { status: response.status, result });
if (response.ok && result.success) {
if (result.success) {
refresh();
} else {
throw new Error(result.message || '삭제에 실패했습니다.');
@@ -239,6 +245,13 @@ export default function ItemListClient() {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
});
// 🚨 401 인증 에러 시 자동 로그인 페이지 리다이렉트
if (response.status === 401) {
await handleApiError(response);
return; // 리다이렉트 후 중단
}
const result = await response.json();
if (response.ok && result.success) {
successCount++;