Merge branch 'main' of http://39.117.244.52:3000/kjs/ERP-node into lhj
; Conflicts: ; frontend/lib/utils/buttonActions.ts
This commit is contained in:
@@ -528,6 +528,8 @@ export class ButtonActionExecutor {
|
||||
const beforeSaveEventDetail = {
|
||||
formData: context.formData,
|
||||
skipDefaultSave: false,
|
||||
validationFailed: false,
|
||||
validationErrors: [] as string[],
|
||||
};
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("beforeFormSave", {
|
||||
@@ -540,6 +542,12 @@ export class ButtonActionExecutor {
|
||||
|
||||
console.log("📦 [handleSave] beforeFormSave 이벤트 후 formData keys:", Object.keys(context.formData || {}));
|
||||
|
||||
// 검증 실패 시 저장 중단
|
||||
if (beforeSaveEventDetail.validationFailed) {
|
||||
console.log("❌ [handleSave] 검증 실패로 저장 중단:", beforeSaveEventDetail.validationErrors);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 🔧 skipDefaultSave 플래그 확인 - SelectedItemsDetailInput 등에서 자체 UPSERT 처리 시 기본 저장 건너뛰기
|
||||
if (beforeSaveEventDetail.skipDefaultSave) {
|
||||
console.log("🚫 [handleSave] skipDefaultSave=true - 기본 저장 로직 건너뛰기 (컴포넌트에서 자체 처리)");
|
||||
|
||||
Reference in New Issue
Block a user