fix(WEB): 매출관리 MobileFilter 빈 값 crash 수정 및 페이지 안정성 강화

- MobileFilter: 단일선택/다중선택 모두 빈 value 필터링 추가 (crash 근본 원인)
- types.ts: vendorName 빈 문자열 → '(거래처 미지정)' 기본값으로 방어
- SalesDetail: 거래처 Select에 빈 id 필터링 추가
- page.tsx: mode=new 분기를 로딩 전으로 이동 (불필요한 API 호출 방지)
- index.tsx: getSales API 직접 호출, 페이지네이션, 자동 로드 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-14 22:17:38 +09:00
parent e4b25e2648
commit 95c9686597
5 changed files with 82 additions and 23 deletions

View File

@@ -30,12 +30,19 @@ export default function SalesPage() {
getSales({ perPage: 100 })
.then(result => {
setData(result.data);
setPagination(result.pagination);
if (result.success) {
setData(result.data);
setPagination(result.pagination);
}
})
.finally(() => setIsLoading(false));
}, [mode]);
// mode=new일 때 등록 화면 표시
if (mode === 'new') {
return <SalesDetail mode="new" />;
}
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
@@ -44,11 +51,6 @@ export default function SalesPage() {
);
}
// mode=new일 때 등록 화면 표시
if (mode === 'new') {
return <SalesDetail mode="new" />;
}
return (
<SalesManagement
initialData={data}