[as] feat: 결재선 검증 로직 수정
This commit is contained in:
@@ -16,7 +16,7 @@ export function validateAtrzOrder(rows: AtrzOrderValidateRow[]): string | null {
|
||||
const visibleRows = rows.filter((row) => !row.isDeleted);
|
||||
|
||||
const finalCount = visibleRows.filter((row) => row.atrzSeComCd === ATRZ_FINAL_CD).length;
|
||||
if (finalCount === 0) {
|
||||
if (visibleRows.length > 0 && finalCount === 0) {
|
||||
return "최종승인자는 반드시 등록해야 합니다.";
|
||||
}
|
||||
if (finalCount > 1) {
|
||||
@@ -52,7 +52,8 @@ export function validateAllRowsForSave(
|
||||
}
|
||||
|
||||
const visibleRows = getVisibleRows(rows);
|
||||
if (visibleRows.length === 0) {
|
||||
const hasDeletedDirtyRows = rows.some((row) => row.isDeleted && row.isDirty);
|
||||
if (visibleRows.length === 0 && !hasDeletedDirtyRows) {
|
||||
return "저장할 결재선이 없습니다.";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user