feat: enhance ButtonPrimaryComponent for source tracking
- Updated ButtonPrimaryComponent to automatically inject source_table and source_id for better data tracking. - Implemented logic to conditionally include source tracking information based on the presence of sourceTableName and row.id. - This enhancement aims to improve data integrity and traceability during data mapping processes, facilitating better integration of source information in the application.
This commit is contained in:
parent
a6aa57fece
commit
fb57bd4eaf
|
|
@ -947,8 +947,19 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
|||
const mappedData = sourceData.map((row) => {
|
||||
const mappedRow = applyMappingRules(row, effectiveMappingRules, entityJoinColumns);
|
||||
|
||||
// 소스 출처 추적: source_table과 source_id를 자동 주입
|
||||
// 타겟 테이블에 해당 컬럼이 있으면 저장되고, 없으면 자동 무시됨
|
||||
const sourceTracking: Record<string, any> = {};
|
||||
if (sourceTableName) {
|
||||
sourceTracking.source_table = sourceTableName;
|
||||
}
|
||||
if (row.id) {
|
||||
sourceTracking.source_id = row.id;
|
||||
}
|
||||
|
||||
return {
|
||||
...mappedRow,
|
||||
...sourceTracking,
|
||||
...additionalData,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue