mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
Fix defaultAIModel deserialization and serialization
Corrects the deserialization of defaultAIModel to ensure it is properly converted from dynamic to Map<String, Object?>. Also fixes a typo in the serialization key from 'defaultLLMSaveObject' to 'defaultAIModel'.
This commit is contained in:
@@ -145,7 +145,9 @@ class SettingsModel {
|
|||||||
final workspaceFolderPath = data["workspaceFolderPath"] as String?;
|
final workspaceFolderPath = data["workspaceFolderPath"] as String?;
|
||||||
final isSSLDisabled = data["isSSLDisabled"] as bool?;
|
final isSSLDisabled = data["isSSLDisabled"] as bool?;
|
||||||
final isDashBotEnabled = data["isDashBotEnabled"] as bool?;
|
final isDashBotEnabled = data["isDashBotEnabled"] as bool?;
|
||||||
final defaultAIModel = data["defaultAIModel"] as Map<String, Object?>?;
|
final defaultAIModel = data["defaultAIModel"] == null
|
||||||
|
? null
|
||||||
|
: Map<String, Object?>.from(data["defaultAIModel"]);
|
||||||
const sm = SettingsModel();
|
const sm = SettingsModel();
|
||||||
|
|
||||||
return sm.copyWith(
|
return sm.copyWith(
|
||||||
@@ -184,7 +186,7 @@ class SettingsModel {
|
|||||||
"workspaceFolderPath": workspaceFolderPath,
|
"workspaceFolderPath": workspaceFolderPath,
|
||||||
"isSSLDisabled": isSSLDisabled,
|
"isSSLDisabled": isSSLDisabled,
|
||||||
"isDashBotEnabled": isDashBotEnabled,
|
"isDashBotEnabled": isDashBotEnabled,
|
||||||
'defaultLLMSaveObject': defaultAIModel,
|
"defaultAIModel": defaultAIModel,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user