feat(web): Improve parser_config initialization with spread operator
- Refactor parser_config assignment to use spread operator for better merging - Preserve existing parser_config values when initializing defaults - Merge graphrag configuration from record if present - Ensure default values are applied while maintaining user-provided settings
This commit is contained in:
@@ -211,7 +211,8 @@ const CreateModal = forwardRef<CreateModalRef, CreateModalRefProps>(({
|
||||
|
||||
// Process parser_config data, set default values if not present
|
||||
const recordAny = record as any;
|
||||
baseValues.parser_config = record.parser_config || {
|
||||
baseValues.parser_config = {
|
||||
...record.parser_config,
|
||||
graphrag: {
|
||||
use_graphrag: false,
|
||||
scene_name: '',
|
||||
@@ -219,6 +220,7 @@ const CreateModal = forwardRef<CreateModalRef, CreateModalRefProps>(({
|
||||
method: 'general',
|
||||
resolution: false,
|
||||
community: false,
|
||||
...(record.parser_config?.graphrag || {})
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user