feat: Add savedIds to UPSERT response and update related components

- Enhanced the UPSERT process in DataService to include savedIds in the response, allowing tracking of newly saved record IDs.
- Updated the dataApi to reflect the new savedIds field in the Promise return type.
- Modified the SelectedItemsDetailInputComponent to handle and inject saved mapping IDs into detail records, improving data integrity and management during the save process.
- Added logging for savedIds to facilitate debugging and tracking of saved records.
This commit is contained in:
DDD1542
2026-02-10 10:06:53 +09:00
parent 45029bf5f4
commit 9e1a54c738
4 changed files with 24 additions and 3 deletions

View File

@@ -742,6 +742,7 @@ router.post(
inserted: result.data?.inserted || 0,
updated: result.data?.updated || 0,
deleted: result.data?.deleted || 0,
savedIds: result.data?.savedIds || [],
});
} catch (error) {
console.error("그룹화된 데이터 UPSERT 오류:", error);

View File

@@ -1519,11 +1519,12 @@ class DataService {
}
}
console.log(`✅ UPSERT 완료:`, { inserted, updated, deleted });
const savedIds = Array.from(processedIds);
console.log(`✅ UPSERT 완료:`, { inserted, updated, deleted, savedIds });
return {
success: true,
data: { inserted, updated, deleted },
data: { inserted, updated, deleted, savedIds },
};
} catch (error) {
console.error(`UPSERT 오류 (${tableName}):`, error);