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
|
// Process parser_config data, set default values if not present
|
||||||
const recordAny = record as any;
|
const recordAny = record as any;
|
||||||
baseValues.parser_config = record.parser_config || {
|
baseValues.parser_config = {
|
||||||
|
...record.parser_config,
|
||||||
graphrag: {
|
graphrag: {
|
||||||
use_graphrag: false,
|
use_graphrag: false,
|
||||||
scene_name: '',
|
scene_name: '',
|
||||||
@@ -219,6 +220,7 @@ const CreateModal = forwardRef<CreateModalRef, CreateModalRefProps>(({
|
|||||||
method: 'general',
|
method: 'general',
|
||||||
resolution: false,
|
resolution: false,
|
||||||
community: false,
|
community: false,
|
||||||
|
...(record.parser_config?.graphrag || {})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user